Skip to content

Commit e224957

Browse files
committedNov 17, 2023
Remove landing page from selection and/or restore selection to default if is no longer valid
1 parent ed1ae8a commit e224957

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed
 

‎src/renderer/components/general-settings/general-settings.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,21 @@ export default defineComponent({
7070
checkForBlogPosts: function () {
7171
return this.$store.getters.getCheckForBlogPosts
7272
},
73+
hidePlaylists: function () {
74+
return this.$store.getters.getHidePlaylists
75+
},
76+
hidePopularVideos: function () {
77+
return this.$store.getters.getHidePopularVideos
78+
},
79+
hideTrendingVideos: function () {
80+
return this.$store.getters.getHideTrendingVideos
81+
},
7382
defaultPages: function () {
74-
return this.$router.getRoutes().filter((route) => this.includedDefaultPageNames.includes(route.name))
83+
let includedPageNames = this.includedDefaultPageNames
84+
if (this.hideTrendingVideos) includedPageNames = includedPageNames.filter((pageName) => pageName !== 'trending')
85+
if (this.hidePlaylists) includedPageNames = includedPageNames.filter((pageName) => pageName !== 'userPlaylists')
86+
if (!(!this.hidePopularVideos && (this.backendFallback || this.backendPreference === 'invidious'))) includedPageNames = includedPageNames.filter((pageName) => pageName !== 'popular')
87+
return this.$router.getRoutes().filter((route) => includedPageNames.includes(route.name))
7588
},
7689
defaultPageNames: function () {
7790
return this.defaultPages.map((route) => this.$t(route.meta.title))
@@ -84,6 +97,11 @@ export default defineComponent({
8497
return this.$store.getters.getBackendPreference
8598
},
8699
landingPage: function () {
100+
const landingPage = this.$store.getters.getLandingPage
101+
// invalidate landing page selection & restore to default value if no longer valid
102+
if (!this.defaultPageValues.includes(landingPage)) {
103+
this.updateLandingPage('subscriptions')
104+
}
87105
return this.$store.getters.getLandingPage
88106
},
89107
region: function () {

0 commit comments

Comments
 (0)