mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-19 03:28:28 -04:00
fix(gui): Lazy load tauri store
This commit is contained in:
parent
253e0b0cf6
commit
e6dc7ddcef
1 changed files with 4 additions and 4 deletions
|
@ -18,7 +18,7 @@ const rootPersistConfig = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Use Tauri's store plugin for persistent settings
|
// Use Tauri's store plugin for persistent settings
|
||||||
const tauriStore = await createStore(`${getNetworkName()}_settings.bin`, {
|
const tauriStore = createStore(`${getNetworkName()}_settings.bin`, {
|
||||||
autoSave: 1000 as unknown as boolean,
|
autoSave: 1000 as unknown as boolean,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ const tauriStore = await createStore(`${getNetworkName()}_settings.bin`, {
|
||||||
const settingsPersistConfig = {
|
const settingsPersistConfig = {
|
||||||
key: "settings",
|
key: "settings",
|
||||||
storage: {
|
storage: {
|
||||||
getItem: (key: string) => tauriStore.get(key),
|
getItem: async (key: string) => (await tauriStore).get(key),
|
||||||
setItem: (key: string, value: unknown) => tauriStore.set(key, value),
|
setItem: async (key: string, value: unknown) => (await tauriStore).set(key, value),
|
||||||
removeItem: (key: string) => tauriStore.delete(key),
|
removeItem: async (key: string) => (await tauriStore).delete(key),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue