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 // Various migrations
console.debug('Migrating from old config') console.debug('Migrating from old config')
const vuexState = (await storage.getItem('vuex-lz')) ?? {} const vuexState = (await storage.getItem('vuex-lz')) ?? {}
console.log('### sc', vuexState)
const config = vuexState.config ?? {} const config = vuexState.config ?? {}
const migratedEntries = new Set(config._syncMigration ?? []) const migratedEntries = new Set(config._syncMigration ?? [])

View file

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