mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-25 16:05:27 +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 let stateStorageKeys: string[] = [];
|
||||||
|
|
||||||
export const stateStorageKey = (stateName: 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])];
|
stateStorageKeys = [...new Set([...stateStorageKeys, stateName])];
|
||||||
return stateName;
|
return stateName;
|
||||||
};
|
};
|
||||||
@ -149,8 +149,7 @@ export const createState = <T extends Record<string, unknown>>(
|
|||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
blacklist,
|
blacklist,
|
||||||
name: stateStorageKey(name),
|
name: stateStorageKey(name)
|
||||||
version: import.meta.env.VITE_SHORTHASH as any
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -73,7 +73,7 @@ export const optReduceState = <S, U>(
|
|||||||
export let stateStorageKeys: string[] = [];
|
export let stateStorageKeys: string[] = [];
|
||||||
|
|
||||||
export const stateStorageKey = (stateName: string) => {
|
export const stateStorageKey = (stateName: string) => {
|
||||||
stateName = `Landscape${stateName}State`;
|
stateName = `Landscape${stateName}State-${process.env.LANDSCAPE_SHORTHASH}`;
|
||||||
stateStorageKeys = [...new Set([...stateStorageKeys, stateName])];
|
stateStorageKeys = [...new Set([...stateStorageKeys, stateName])];
|
||||||
return stateName;
|
return stateName;
|
||||||
};
|
};
|
||||||
@ -140,8 +140,7 @@ export const createState = <T extends {}>(
|
|||||||
...(typeof properties === 'function' ? (properties as any)(set, get) : properties)
|
...(typeof properties === 'function' ? (properties as any)(set, get) : properties)
|
||||||
}), {
|
}), {
|
||||||
blacklist,
|
blacklist,
|
||||||
name: stateStorageKey(name),
|
name: stateStorageKey(name)
|
||||||
version: process.env.LANDSCAPE_SHORTHASH as any
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
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>)[]) {
|
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