diff --git a/src/stores/serverSideStorage.js b/src/stores/serverSideStorage.js index 99f5045f7..23c027b1e 100644 --- a/src/stores/serverSideStorage.js +++ b/src/stores/serverSideStorage.js @@ -16,6 +16,10 @@ import { defineStore } from 'pinia' import { toRaw } from 'vue' import { CURRENT_UPDATE_COUNTER } from 'src/components/update_notification/update_notification.js' +import { + defaultState as configDefaultState, + instanceDefaultConfig, +} from 'src/modules/default_config_state' export const VERSION = 1 export const NEW_USER_DATE = new Date('2022-08-04') // date of writing this, basically @@ -41,6 +45,11 @@ export const defaultState = { dontShowUpdateNotifs: false, collapseNav: false, muteFilters: {}, + ...{ + // reverting all the undefined to their initial values + ...configDefaultState, + ...instanceDefaultConfig, + }, }, collections: { pinnedStatusActions: ['reply', 'retweet', 'favorite', 'emoji'], @@ -128,7 +137,7 @@ export const _getRecentData = (cache, live, isTest) => { live._version === cache._version ) { console.debug( - 'Same version/timestamp on both source, source of truth irrelevant', + 'Same version/timestamp on both sources, source of truth irrelevant', ) result.recent = cache result.stale = live @@ -640,4 +649,9 @@ export const useServerSideStorageStore = defineStore('serverSideStorage', { }) }, }, + persist: { + afterLoad(state) { + return state + }, + }, })