feat: added ability to hide Playlists (#972)

This commit is contained in:
Sai Deepesh 2021-03-06 21:51:22 +05:30 committed by GitHub
parent cd13691980
commit 8c88571f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 0 deletions

View File

@ -37,6 +37,9 @@ export default Vue.extend({
hidePopularVideos: function () { hidePopularVideos: function () {
return this.$store.getters.getHidePopularVideos return this.$store.getters.getHidePopularVideos
}, },
hidePlaylists: function () {
return this.$store.getters.getHidePlaylists
},
hideLiveChat: function () { hideLiveChat: function () {
return this.$store.getters.getHideLiveChat return this.$store.getters.getHideLiveChat
}, },
@ -61,6 +64,7 @@ export default Vue.extend({
'updateHideRecommendedVideos', 'updateHideRecommendedVideos',
'updateHideTrendingVideos', 'updateHideTrendingVideos',
'updateHidePopularVideos', 'updateHidePopularVideos',
'updateHidePlaylists',
'updateHideLiveChat', 'updateHideLiveChat',
'updateHideActiveSubscriptions', 'updateHideActiveSubscriptions',
'updatePlayNextVideo', 'updatePlayNextVideo',

View File

@ -59,6 +59,12 @@
:default-value="hidePopularVideos" :default-value="hidePopularVideos"
@change="updateHidePopularVideos" @change="updateHidePopularVideos"
/> />
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Playlists')"
:compact="true"
:default-value="hidePlaylists"
@change="updateHidePlaylists"
/>
<ft-toggle-switch <ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Live Chat')" :label="$t('Settings.Distraction Free Settings.Hide Live Chat')"
:compact="true" :compact="true"

View File

@ -48,6 +48,9 @@ export default Vue.extend({
hidePopularVideos: function () { hidePopularVideos: function () {
return this.$store.getters.getHidePopularVideos return this.$store.getters.getHidePopularVideos
}, },
hidePlaylists: function () {
return this.$store.getters.getHidePlaylists
},
hideTrendingVideos: function () { hideTrendingVideos: function () {
return this.$store.getters.getHideTrendingVideos return this.$store.getters.getHideTrendingVideos
}, },

View File

@ -44,6 +44,7 @@
</p> </p>
</div> </div>
<div <div
v-if="!hidePlaylists"
class="navOption mobileShow" class="navOption mobileShow"
@click="navigate('userplaylists')" @click="navigate('userplaylists')"
> >

View File

@ -74,6 +74,7 @@ const state = {
hideRecommendedVideos: false, hideRecommendedVideos: false,
hideTrendingVideos: false, hideTrendingVideos: false,
hidePopularVideos: false, hidePopularVideos: false,
hidePlaylists: false,
hideLiveChat: false, hideLiveChat: false,
hideActiveSubscriptions: false hideActiveSubscriptions: false
} }
@ -242,9 +243,15 @@ const getters = {
getHidePopularVideos: () => { getHidePopularVideos: () => {
return state.hidePopularVideos return state.hidePopularVideos
}, },
getHidePlaylists: () => {
return state.hidePlaylists
},
getHideLiveChat: () => { getHideLiveChat: () => {
return state.hideLiveChat return state.hideLiveChat
}, },
getHideActiveSubscriptions: () => { getHideActiveSubscriptions: () => {
return state.hideActiveSubscriptions return state.hideActiveSubscriptions
} }
@ -383,6 +390,9 @@ const actions = {
case 'hidePopularVideos': case 'hidePopularVideos':
commit('setHidePopularVideos', result.value) commit('setHidePopularVideos', result.value)
break break
case 'hidePlaylists':
commit('setHidePlaylists', result.value)
break
case 'hideLiveChat': case 'hideLiveChat':
commit('setHideLiveChat', result.value) commit('setHideLiveChat', result.value)
break break
@ -717,6 +727,14 @@ const actions = {
}) })
}, },
updateHidePlaylists ({ commit }, hidePlaylists) {
settingsDb.update({ _id: 'hidePlaylists' }, { _id: 'hidePlaylists', value: hidePlaylists }, { upsert: true }, (err, numReplaced) => {
if (!err) {
commit('setHidePlaylists', hidePlaylists)
}
})
},
updateHideActiveSubscriptions ({ commit }, hideActiveSubscriptions) { updateHideActiveSubscriptions ({ commit }, hideActiveSubscriptions) {
settingsDb.update({ _id: 'hideActiveSubscriptions' }, { _id: 'hideActiveSubscriptions', value: hideActiveSubscriptions }, { upsert: true }, (err, numReplaced) => { settingsDb.update({ _id: 'hideActiveSubscriptions' }, { _id: 'hideActiveSubscriptions', value: hideActiveSubscriptions }, { upsert: true }, (err, numReplaced) => {
if (!err) { if (!err) {
@ -873,6 +891,9 @@ const mutations = {
setHidePopularVideos (state, hidePopularVideos) { setHidePopularVideos (state, hidePopularVideos) {
state.hidePopularVideos = hidePopularVideos state.hidePopularVideos = hidePopularVideos
}, },
setHidePlaylists (state, hidePlaylists) {
state.hidePlaylists = hidePlaylists
},
setHideLiveChat (state, hideLiveChat) { setHideLiveChat (state, hideLiveChat) {
state.hideLiveChat = hideLiveChat state.hideLiveChat = hideLiveChat
}, },

View File

@ -219,6 +219,7 @@ Settings:
Hide Recommended Videos: Hide Recommended Videos Hide Recommended Videos: Hide Recommended Videos
Hide Trending Videos: Hide Trending Videos Hide Trending Videos: Hide Trending Videos
Hide Popular Videos: Hide Popular Videos Hide Popular Videos: Hide Popular Videos
Hide Playlists: Hide Playlists
Hide Live Chat: Hide Live Chat Hide Live Chat: Hide Live Chat
Hide Active Subscriptions: Hide Active Subscriptions Hide Active Subscriptions: Hide Active Subscriptions
Data Settings: Data Settings: