fix currentUser binding

This commit is contained in:
FloatingGhost 2022-08-03 13:32:37 +01:00
parent 553ee6c8d1
commit 1a01e64cb5
1 changed files with 9 additions and 21 deletions

View File

@ -35,25 +35,15 @@ const TimelineMenu = {
this.$store.dispatch('setLastTimeline', this.$route.name)
}
},
computed: {
currentUser () {
return this.$store.state.users.currentUser
},
privateMode () {
return this.$store.state.instance.private
}
},
methods: {
openMenu () {
// $nextTick is too fast, animation won't play back but
// instead starts in fully open position. Low values
// like 1-5 work on fast machines but not on mobile, 25
// seems like a good compromise that plays without significant
// added lag.
setTimeout(() => {
this.isOpen = true
}, 25)
},
blockOpen (event) {
// For the blank area inside the button element.
// Just setting @click.stop="" makes unintuitive behavior when
// menu is open and clicking on the blank area doesn't close it.
if (!this.isOpen) {
event.stopPropagation()
}
},
timelineName () {
const route = this.$route.name
if (route === 'tag-timeline') {
@ -64,9 +54,7 @@ const TimelineMenu = {
}
const i18nkey = timelineNames()[this.$route.name]
return i18nkey ? this.$t(i18nkey) : route
},
currentUser () { return this.$store.state.users.currentUser },
privateMode () { return this.$store.state.instance.private }
}
}
}