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

View File

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

View File

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

View File

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

View File

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

View File

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