Fix hide sharing actions also hiding hide/show channel (#5110)

This commit is contained in:
absidue 2024-05-14 11:17:48 +02:00 committed by GitHub
parent a9c9f10059
commit 2fcd5c985e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 17 deletions

View File

@ -285,28 +285,32 @@ export default defineComponent({
{
label: this.$t('Video.Open Channel in Invidious'),
value: 'openInvidiousChannel'
},
{
type: 'divider'
}
)
const hiddenChannels = JSON.parse(this.$store.getters.getChannelsHidden)
const channelShouldBeHidden = hiddenChannels.some(c => c === this.channelId)
if (channelShouldBeHidden) {
options.push({
label: this.$t('Video.Unhide Channel'),
value: 'unhideChannel'
})
} else {
options.push({
label: this.$t('Video.Hide Channel'),
value: 'hideChannel'
})
}
}
}
if (this.channelId !== null) {
const hiddenChannels = JSON.parse(this.$store.getters.getChannelsHidden)
const channelShouldBeHidden = hiddenChannels.some(c => c === this.channelId)
options.push(
{
type: 'divider'
},
channelShouldBeHidden
? {
label: this.$t('Video.Unhide Channel'),
value: 'unhideChannel'
}
: {
label: this.$t('Video.Hide Channel'),
value: 'hideChannel'
}
)
}
return options
},