diff --git a/src/renderer/components/SubscriptionsTabUi/SubscriptionsTabUi.vue b/src/renderer/components/SubscriptionsTabUi/SubscriptionsTabUi.vue index 425b8aa60b6a7..86d1d4dcdbb6e 100644 --- a/src/renderer/components/SubscriptionsTabUi/SubscriptionsTabUi.vue +++ b/src/renderer/components/SubscriptionsTabUi/SubscriptionsTabUi.vue @@ -125,10 +125,10 @@ const subscriptionLimit = sessionStorage.getItem('subscriptionLimit') const dataLimit = ref(subscriptionLimit !== null ? parseInt(subscriptionLimit) : props.initialDataLimit) const activeVideoList = computed(() => { - if (props.videoList.length < dataLimit.value) { - return props.videoList + if (filteredVideoList.value.length < dataLimit.value) { + return filteredVideoList.value } else { - return props.videoList.slice(0, dataLimit.value) + return filteredVideoList.value.slice(0, dataLimit.value) } }) @@ -141,6 +141,24 @@ const fetchSubscriptionsAutomatically = computed(() => { return store.getters.getFetchSubscriptionsAutomatically }) +const historyCacheById = computed(() => { + return store.getters.getHistoryCacheById +}) + +const hideWatchedSubs = computed(() => { + return store.getters.getHideWatchedSubs +}) + +const filteredVideoList = computed(() => { + if (hideWatchedSubs.value && !props.isCommunity) { + return props.videoList.filter((video) => { + return !Object.hasOwn(historyCacheById.value, video.videoId) + }) + } else { + return props.videoList + } +}) + function increaseLimit() { dataLimit.value += props.initialDataLimit sessionStorage.setItem('subscriptionLimit', dataLimit.value.toFixed(0)) diff --git a/src/renderer/helpers/subscriptions.js b/src/renderer/helpers/subscriptions.js index 854e6d2aca69e..e7116b7158ef9 100644 --- a/src/renderer/helpers/subscriptions.js +++ b/src/renderer/helpers/subscriptions.js @@ -31,14 +31,6 @@ export function updateVideoListAfterProcessing(videos) { }) } - if (store.getters.getHideWatchedSubs) { - const historyCacheById = store.getters.getHistoryCacheById - - videoList = videoList.filter((video) => { - return !Object.hasOwn(historyCacheById, video.videoId) - }) - } - // ordered last to show first eligible video from channel // if the first one incidentally failed one of the above checks if (store.getters.getOnlyShowLatestFromChannel) {