fix sss not saving cache locally
This commit is contained in:
parent
02f952047d
commit
8bbc17f982
1 changed files with 15 additions and 1 deletions
|
|
@ -16,6 +16,10 @@ import { defineStore } from 'pinia'
|
||||||
import { toRaw } from 'vue'
|
import { toRaw } from 'vue'
|
||||||
|
|
||||||
import { CURRENT_UPDATE_COUNTER } from 'src/components/update_notification/update_notification.js'
|
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 VERSION = 1
|
||||||
export const NEW_USER_DATE = new Date('2022-08-04') // date of writing this, basically
|
export const NEW_USER_DATE = new Date('2022-08-04') // date of writing this, basically
|
||||||
|
|
@ -41,6 +45,11 @@ export const defaultState = {
|
||||||
dontShowUpdateNotifs: false,
|
dontShowUpdateNotifs: false,
|
||||||
collapseNav: false,
|
collapseNav: false,
|
||||||
muteFilters: {},
|
muteFilters: {},
|
||||||
|
...{
|
||||||
|
// reverting all the undefined to their initial values
|
||||||
|
...configDefaultState,
|
||||||
|
...instanceDefaultConfig,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
collections: {
|
collections: {
|
||||||
pinnedStatusActions: ['reply', 'retweet', 'favorite', 'emoji'],
|
pinnedStatusActions: ['reply', 'retweet', 'favorite', 'emoji'],
|
||||||
|
|
@ -128,7 +137,7 @@ export const _getRecentData = (cache, live, isTest) => {
|
||||||
live._version === cache._version
|
live._version === cache._version
|
||||||
) {
|
) {
|
||||||
console.debug(
|
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.recent = cache
|
||||||
result.stale = live
|
result.stale = live
|
||||||
|
|
@ -640,4 +649,9 @@ export const useServerSideStorageStore = defineStore('serverSideStorage', {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
persist: {
|
||||||
|
afterLoad(state) {
|
||||||
|
return state
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue