diff --git a/src/client/index.tsx b/src/client/index.tsx index d5c82a3c..da297a9a 100644 --- a/src/client/index.tsx +++ b/src/client/index.tsx @@ -340,13 +340,15 @@ export function apply(ctx: Context): void { if (decision?.suspended) unmount() else mount() } - void sync() + // setPrefs and mount() run inside sync(); a rejection there would leave + // the sidebar unmounted with a dead toggle as its only symptom. + void sync().catch((error) => { fail('sync', error) }) // Live re-evaluation: the runtime broadcasts settings-document updates // (the aionui card saves through the same document). Best effort — // deployments without the 'remote' service fall back to boot-time // evaluation only. const remote = ctx.get('remote') as { $on?: (event: string, listener: () => void) => () => void } | undefined - const offRemote = remote?.$on?.('settings/document-updated', () => { void sync() }) + const offRemote = remote?.$on?.('settings/document-updated', () => { void sync().catch((error) => { fail('sync', error) }) }) return () => { disposed = true offRemote?.()