diff --git a/src/renderer/components/privacy-settings/privacy-settings.js b/src/renderer/components/privacy-settings/privacy-settings.js index 03d65a5f88d6..0b541e0a532d 100644 --- a/src/renderer/components/privacy-settings/privacy-settings.js +++ b/src/renderer/components/privacy-settings/privacy-settings.js @@ -94,24 +94,24 @@ export default defineComponent({ this.updateActiveProfile(MAIN_PROFILE_ID) - if (option === 'yes') { - this.profileList.forEach((profile) => { - if (profile._id === MAIN_PROFILE_ID) { - const newProfile = { - _id: MAIN_PROFILE_ID, - name: profile.name, - bgColor: profile.bgColor, - textColor: profile.textColor, - subscriptions: [] - } - this.updateProfile(newProfile) - } else { - this.removeProfile(profile._id) + if (option !== 'yes') { return } + + this.profileList.forEach((profile) => { + if (profile._id === MAIN_PROFILE_ID) { + const newProfile = { + _id: MAIN_PROFILE_ID, + name: profile.name, + bgColor: profile.bgColor, + textColor: profile.textColor, + subscriptions: [] } - }) + this.updateProfile(newProfile) + } else { + this.removeProfile(profile._id) + } + }) - this.clearSubscriptionsCache() - } + this.clearSubscriptionsCache() }, ...mapActions([ diff --git a/src/renderer/store/modules/subscriptions.js b/src/renderer/store/modules/subscriptions.js index ba86c3b54cd3..e9b0c4e1efc7 100644 --- a/src/renderer/store/modules/subscriptions.js +++ b/src/renderer/store/modules/subscriptions.js @@ -35,33 +35,27 @@ const getters = { getLiveCacheByChannel: (state) => (channelId) => { return state.liveCache[channelId] - } + }, } const actions = { - clearSubscriptionVideosCache: ({ commit }) => { - commit('clearVideoCache') - }, - updateSubscriptionVideosCacheByChannel: ({ commit }, payload) => { commit('updateVideoCacheByChannel', payload) }, - clearSubscriptionShortsCache: ({ commit }) => { - commit('clearShortsCache') - }, - updateSubscriptionShortsCacheByChannel: ({ commit }, payload) => { commit('updateShortsCacheByChannel', payload) }, - clearSubscriptionLiveCache: ({ commit }) => { - commit('clearLiveCache') - }, - updateSubscriptionLiveCacheByChannel: ({ commit }, payload) => { commit('updateLiveCacheByChannel', payload) - } + }, + + clearSubscriptionsCache: ({ commit }, payload) => { + commit('clearVideoCache', payload) + commit('clearShortsCache', payload) + commit('clearLiveCache', payload) + }, } const mutations = { @@ -91,7 +85,7 @@ const mutations = { }, clearLiveCache(state) { state.liveCache = {} - } + }, } export default {