show tag name in title for tag timelines

This commit is contained in:
Shpuld Shpuldson 2020-08-19 13:06:46 +03:00
parent 1a8840c7c3
commit 54b619dfec
2 changed files with 12 additions and 6 deletions

View file

@ -9,7 +9,8 @@ export const timelineNames = () => {
'bookmarks': 'nav.bookmarks', 'bookmarks': 'nav.bookmarks',
'dms': 'nav.dms', 'dms': 'nav.dms',
'public-timeline': 'nav.public_tl', 'public-timeline': 'nav.public_tl',
'public-external-timeline': 'nav.twkn' 'public-external-timeline': 'nav.twkn',
'tag-timeline': 'tag'
} }
} }
@ -40,6 +41,14 @@ const TimelineMenu = {
setTimeout(() => { setTimeout(() => {
this.isOpen = true this.isOpen = true
}, 25) }, 25)
},
timelineName () {
const route = this.$route.name
if (route === 'tag-timeline') {
return '#' + this.$route.params.tag
}
const i18nkey = timelineNames()[this.$route.name]
return i18nkey ? this.$t(i18nkey) : route
} }
}, },
computed: { computed: {
@ -47,10 +56,7 @@ const TimelineMenu = {
currentUser: state => state.users.currentUser, currentUser: state => state.users.currentUser,
privateMode: state => state.instance.private, privateMode: state => state.instance.private,
federating: state => state.instance.federating federating: state => state.instance.federating
}), })
timelineNames () {
return timelineNames()
}
} }
} }

View file

@ -45,7 +45,7 @@
slot="trigger" slot="trigger"
class="title timeline-menu-title" class="title timeline-menu-title"
> >
<span>{{ $t(timelineNames[$route.name]) }}</span> <span>{{ timelineName() }}</span>
<i class="icon-down-open" /> <i class="icon-down-open" />
</div> </div>
</Popover> </Popover>