This commit is contained in:
Henry Jameson 2026-04-10 16:21:34 +03:00
commit 2563f6d285
2 changed files with 6 additions and 4 deletions

View file

@ -677,6 +677,7 @@ export const useSyncConfigStore = defineStore('sync_config', {
// Various migrations
console.debug('Migrating from old config')
const vuexState = (await storage.getItem('vuex-lz')) ?? {}
console.log('### sc', vuexState)
const config = vuexState.config ?? {}
const migratedEntries = new Set(config._syncMigration ?? [])

View file

@ -278,21 +278,22 @@ export const useUserHighlightStore = defineStore('user_highlight', {
let dirty = false
const vuexState = (await storage.getItem('vuex-lz')) ?? {}
vuexState.config = vuexState.config ?? {}
const highlight = vuexState.config.highlight ?? {}
const config = vuexState.config ?? {}
const highlight = config.highlight ?? {}
Object.entries(highlight).forEach(([user, value]) => {
if ((highlight[user]._migrated || 0) < 1) {
dirty = true
needUpload = true
this.set({ user, value: clone(value) })
vuexState.config.highlight[user]._migrated = 1
highlight[user]._migrated = 1
console.debug(
`[HIGHLIGHT] Migrating user ${user}: ${JSON.stringify(value)}`,
)
}
})
storage.setItem('vuex-lz', vuexState)
console.log('### uh', vuexState)
//storage.setItem('vuex-lz', { ...vuexState, config: { ...config, highlight } })
if (recent === null) {
console.debug(