Skip to content

Commit 048dab0

Browse files
authored
Cleanup unused channel hiding code in ft-list-video-numbered (#5208)
1 parent b0b2af1 commit 048dab0

File tree

2 files changed

+2
-39
lines changed

2 files changed

+2
-39
lines changed

src/renderer/components/ft-list-video-numbered/ft-list-video-numbered.js

+2-38
Original file line numberDiff line numberDiff line change
@@ -74,46 +74,16 @@ export default defineComponent({
7474
isCurrentVideo: {
7575
type: Boolean,
7676
default: false
77-
},
78-
useChannelsHiddenPreference: {
79-
type: Boolean,
80-
default: false,
8177
}
8278
},
8379
emits: ['move-video-down', 'move-video-up', 'pause-player', 'remove-from-playlist'],
8480
data: function () {
8581
return {
86-
visible: false,
87-
show: true,
82+
visible: this.initialVisibleState,
8883
stopWatchingInitialVisibleState: null
8984
}
9085
},
91-
computed: {
92-
channelsHidden() {
93-
// Some component users like channel view will have this disabled
94-
if (!this.useChannelsHiddenPreference) { return [] }
95-
96-
return JSON.parse(this.$store.getters.getChannelsHidden).map((ch) => {
97-
// Legacy support
98-
if (typeof ch === 'string') {
99-
return { name: ch, preferredName: '', icon: '' }
100-
}
101-
return ch
102-
})
103-
},
104-
105-
// As we only use this component in Playlist and watch-video-playlist,
106-
// where title filtering is never desired, we don't have any title filtering logic here,
107-
// like we do in ft-list-video-lazy
108-
109-
shouldBeVisible() {
110-
return !(this.channelsHidden.some(ch => ch.name === this.data.authorId) ||
111-
this.channelsHidden.some(ch => ch.name === this.data.author))
112-
}
113-
},
11486
created() {
115-
this.visible = this.initialVisibleState
116-
11787
if (!this.initialVisibleState) {
11888
this.stopWatchingInitialVisibleState = this.$watch('initialVisibleState', (newValue) => {
11989
this.visible = newValue
@@ -124,18 +94,12 @@ export default defineComponent({
12494
},
12595
methods: {
12696
onVisibilityChanged: function (visible) {
127-
if (visible && this.shouldBeVisible) {
97+
if (visible) {
12898
this.visible = visible
12999
if (this.stopWatchingInitialVisibleState) {
130100
this.stopWatchingInitialVisibleState()
131101
this.stopWatchingInitialVisibleState = null
132102
}
133-
} else if (visible) {
134-
this.show = false
135-
if (this.stopWatchingInitialVisibleState) {
136-
this.stopWatchingInitialVisibleState()
137-
this.stopWatchingInitialVisibleState = null
138-
}
139103
}
140104
},
141105
pausePlayer: function () {

src/renderer/components/ft-list-video-numbered/ft-list-video-numbered.vue

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div
3-
v-show="show"
43
v-observe-visibility="initialVisibleState || visible ? false : {
54
callback: onVisibilityChanged,
65
once: true,

0 commit comments

Comments
 (0)