Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.message {
color: var(--tertiary-text-color);
inline-size: fit-content;
margin-inline: auto;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<template>
<p
v-if="useRssFeeds"
class="message"
>
{{
t('Subscriptions.Posts.RSS Message', {
rssSetting: t('Settings.Subscription Settings.Fetch Feeds from RSS'),
hideSetting: t('Settings.Distraction Free Settings.Hide Subscriptions Posts')
})
}}
</p>
<SubscriptionsTabUi
v-else
:is-loading="isLoading"
:video-list="postList"
:error-channels="errorChannels"
Expand All @@ -16,13 +28,13 @@
import { computed, onMounted, ref, shallowRef, watch } from 'vue'
import { useI18n } from 'vue-i18n'

import SubscriptionsTabUi from './SubscriptionsTabUi/SubscriptionsTabUi.vue'
import SubscriptionsTabUi from '../SubscriptionsTabUi/SubscriptionsTabUi.vue'

import store from '../store/index'
import store from '../../store/index'

import { copyToClipboard, getRelativeTimeFromDate, showToast } from '../helpers/utils'
import { getLocalChannelCommunity } from '../helpers/api/local'
import { invidiousGetCommunityPosts } from '../helpers/api/invidious'
import { copyToClipboard, getRelativeTimeFromDate, showToast } from '../../helpers/utils.js'
import { getLocalChannelCommunity } from '../../helpers/api/local.js'
import { invidiousGetCommunityPosts } from '../../helpers/api/invidious.js'

const { t } = useI18n()

Expand All @@ -47,6 +59,9 @@ const subscriptionCacheReady = computed(() => store.getters.getSubscriptionCache
/** @type {import('vue').ComputedRef<boolean>} */
const fetchSubscriptionsAutomatically = computed(() => store.getters.getFetchSubscriptionsAutomatically)

/** @type {import('vue').ComputedRef<boolean>} */
const useRssFeeds = computed(() => store.getters.getUseRssFeeds)

const activeSubscriptionList = computed(() => store.getters.getActiveProfile.subscriptions)

const cacheEntriesForAllActiveProfileChannels = computed(() => {
Expand Down Expand Up @@ -114,9 +129,11 @@ if (!subscriptionCacheReady.value) {
})
}

onMounted(() => {
loadPostsFromRemoteFirstPerWindowSometimes()
})
if (!useRssFeeds.value) {
onMounted(() => {
loadPostsFromRemoteFirstPerWindowSometimes()
})
}

function loadPostsFromRemoteFirstPerWindowSometimes() {
if (
Expand Down Expand Up @@ -306,3 +323,5 @@ async function getChannelPostsInvidious(channel) {
}
}
</script>

<style scoped src="./SubscriptionPosts.css" />
12 changes: 3 additions & 9 deletions src/renderer/views/Subscriptions/Subscriptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</div>
<!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -->
<div
v-if="visibleTabs.includes('community')"
v-if="!hideSubscriptionsCommunity"
ref="communityTab"
class="tab"
role="tab"
Expand Down Expand Up @@ -133,7 +133,7 @@ import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
import SubscriptionsVideos from '../../components/SubscriptionsVideos.vue'
import SubscriptionsLive from '../../components/SubscriptionsLive.vue'
import SubscriptionsShorts from '../../components/SubscriptionsShorts.vue'
import SubscriptionsPosts from '../../components/SubscriptionsPosts.vue'
import SubscriptionsPosts from '../../components/SubscriptionPosts/SubscriptionsPosts.vue'

import store from '../../store/index'

Expand All @@ -157,11 +157,6 @@ const hideSubscriptionsCommunity = computed(() => {
return store.getters.getHideSubscriptionsCommunity
})

/** @type {import('vue').ComputedRef<boolean>} */
const useRssFeeds = computed(() => {
return store.getters.getUseRssFeeds
})

/** @type {import('vue').Ref<'videos' | 'shorts' | 'live' | 'community' | null>} */
const currentTab = ref('videos')

Expand Down Expand Up @@ -190,8 +185,7 @@ const visibleTabs = computed(() => {
tabs.push('live')
}

// community does not support rss
if (!hideSubscriptionsCommunity.value && !useRssFeeds.value) {
if (!hideSubscriptionsCommunity.value) {
tabs.push('community')
}

Expand Down
2 changes: 2 additions & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ Subscriptions:
Load More Posts: Load More Posts
Subscriptions Tabs: Subscriptions Tabs
All Subscription Tabs Hidden: 'All subscription tabs are hidden. To see content here, please unhide some tabs in the "{subsection}" section in "{settingsSection}".'
Posts:
RSS Message: YouTube does not provide RSS feeds for posts. Disable the "{rssSetting}" setting to view posts or enable the "{hideSetting}" setting to hide this tab.
More: More
Channels:
Channels: Channels
Expand Down
Loading