updater stuff
All checks were successful
/ upload (release) Successful in 1m41s

This commit is contained in:
pavel 2026-02-27 12:35:56 +01:00
commit ad6eaad5d2
4 changed files with 83 additions and 62 deletions

View file

@ -95,19 +95,18 @@ async function storageRemoveCritical(key) {
async function hydrateDesktopStorage() {
if (!window.electronAPI?.storageGet) return;
for (const key of PERSISTED_STORAGE_KEYS) {
const localVal = localStorage.getItem(key);
if (localVal !== null) {
try {
await window.electronAPI.storageSet(key, localVal);
} catch (err) {
console.warn("Failed to backfill storage key", key, err);
}
continue;
}
try {
// IPC file store (renderer-storage.json) is the source of truth —
// it always survives restarts, unlike localStorage on file:// URLs.
const val = await window.electronAPI.storageGet(key);
if (typeof val === "string") {
localStorage.setItem(key, val);
} else {
// IPC store is empty; backfill from localStorage if available
const localVal = localStorage.getItem(key);
if (localVal !== null) {
await window.electronAPI.storageSet(key, localVal);
}
}
} catch (err) {
console.warn("Failed to hydrate storage key", key, err);