mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 13:54:20 +03:00
grid, interface: fix localStorage versioning
This commit is contained in:
parent
e1ee384e05
commit
b532e629f3
@ -74,7 +74,7 @@ export const optReduceState = <S extends Record<string, unknown>, U>(
|
||||
export let stateStorageKeys: string[] = [];
|
||||
|
||||
export const stateStorageKey = (stateName: string) => {
|
||||
stateName = `Landscape${stateName}State`;
|
||||
stateName = `Grid${stateName}State-${import.meta.env.VITE_SHORTHASH as any}`;
|
||||
stateStorageKeys = [...new Set([...stateStorageKeys, stateName])];
|
||||
return stateName;
|
||||
};
|
||||
@ -149,8 +149,7 @@ export const createState = <T extends Record<string, unknown>>(
|
||||
}),
|
||||
{
|
||||
blacklist,
|
||||
name: stateStorageKey(name),
|
||||
version: import.meta.env.VITE_SHORTHASH as any
|
||||
name: stateStorageKey(name)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
@ -73,7 +73,7 @@ export const optReduceState = <S, U>(
|
||||
export let stateStorageKeys: string[] = [];
|
||||
|
||||
export const stateStorageKey = (stateName: string) => {
|
||||
stateName = `Landscape${stateName}State`;
|
||||
stateName = `Landscape${stateName}State-${process.env.LANDSCAPE_SHORTHASH}`;
|
||||
stateStorageKeys = [...new Set([...stateStorageKeys, stateName])];
|
||||
return stateName;
|
||||
};
|
||||
@ -140,8 +140,7 @@ export const createState = <T extends {}>(
|
||||
...(typeof properties === 'function' ? (properties as any)(set, get) : properties)
|
||||
}), {
|
||||
blacklist,
|
||||
name: stateStorageKey(name),
|
||||
version: process.env.LANDSCAPE_SHORTHASH as any
|
||||
name: stateStorageKey(name)
|
||||
}));
|
||||
|
||||
export async function doOptimistically<A, S extends {}>(state: UseStore<S & BaseState<S>>, action: A, call: (a: A) => Promise<any>, reduce: ((a: A, fn: S & BaseState<S>) => S & BaseState<S>)[]) {
|
||||
|
Loading…
Reference in New Issue
Block a user