mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 09:19:56 -05:00
Feat: Implement Storage-based (JSON) Settings & Data-Storage (WIP) (#56)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { store } from "@store/state.svelte";
|
||||
import { probeServer, loginBasic } from "@core/auth";
|
||||
import { trackingState } from "@features/tracking/store/trackingState.svelte";
|
||||
import { store } from "@store/state.svelte";
|
||||
import { probeServer, loginBasic } from "@core/auth";
|
||||
import { trackingState } from "@features/tracking/store/trackingState.svelte";
|
||||
import { loadAllStores } from "@core/persistence/persist";
|
||||
|
||||
const MAX_ATTEMPTS = 40;
|
||||
|
||||
@@ -18,6 +19,11 @@ export const boot = $state({
|
||||
|
||||
let probeGeneration = 0;
|
||||
|
||||
export async function initStore() {
|
||||
const saved = await loadAllStores();
|
||||
store.hydrate(saved);
|
||||
}
|
||||
|
||||
export function startProbe() {
|
||||
const gen = ++probeGeneration;
|
||||
boot.failed = false;
|
||||
@@ -109,4 +115,4 @@ export function bypassBoot(onReady: () => void) {
|
||||
boot.loginRequired = false;
|
||||
boot.unsupportedMode = false;
|
||||
onReady();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user