fix(background-store): rename store id to avoid collision with stage-layouts
This commit is contained in:
@@ -35,7 +35,16 @@ const BUILTIN_BACKGROUNDS = [
|
||||
},
|
||||
]
|
||||
|
||||
export const useBackgroundStore = defineStore('background', () => {
|
||||
// NOTICE:
|
||||
// id is `background-entries` (not `background`) to avoid colliding with
|
||||
// stage-layouts' `defineStore('background', ...)` — Pinia uses the string id
|
||||
// as a global singleton key, so two stores with the same id resolve to
|
||||
// whichever was registered first at runtime (TS cannot detect this since the
|
||||
// shape is inferred per-module).
|
||||
// Source: packages/stage-layouts/src/stores/background.ts.
|
||||
// Removal condition: when this store is merged with stage-layouts' store, or
|
||||
// the string id collision is enforced at the type level.
|
||||
export const useBackgroundStore = defineStore('background-entries', () => {
|
||||
const STORAGE_PREFIX = 'bg-'
|
||||
|
||||
const entries = ref<Map<string, BackgroundEntry>>(new Map())
|
||||
|
||||
Reference in New Issue
Block a user