diff --git a/src/app/components/Startup.svelte b/src/app/components/Startup.svelte new file mode 100644 index 00000000..923fd064 --- /dev/null +++ b/src/app/components/Startup.svelte @@ -0,0 +1,52 @@ + + +{#if error || stalled} +
+

+ {#if error} + {PLATFORM_NAME} couldn't start + {:else} + {PLATFORM_NAME} is still starting + {/if} +

+

+ This usually means your signer isn't responding. Logging out clears this device and takes you + back to the login screen. +

+ +
+{/if} diff --git a/src/app/session.ts b/src/app/session.ts index 23b6c006..5df74ab9 100644 --- a/src/app/session.ts +++ b/src/app/session.ts @@ -84,15 +84,19 @@ export const restoreSession = async () => { }) } -export const logout = async () => { - await deactivateCurrentPomadeSession() - await Push.disable() +// A revoked signer can leave the app unable to start, so this clears the device without asking it anything. +export const resetSession = async () => { await kv.clear() await ss.clear() await storage.get()?.clear() - app.get().cleanup() localStorage.clear() window.location.href = "/" } + +export const logout = async () => { + await deactivateCurrentPomadeSession() + await Push.disable() + await resetSession() +} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 3ebb07a0..cb5fecdd 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -19,6 +19,7 @@ import * as plugins from "@welshman/app" import {isMobile, documentActive} from "@lib/html" import AppContainer from "@app/components/AppContainer.svelte" + import Startup from "@app/components/Startup.svelte" import ModalContainer from "@app/components/ModalContainer.svelte" import * as core from "@app/core" import {goToChat, goToHome, setupHistory} from "@app/routes" @@ -320,15 +321,17 @@ {/if} -{#await unsubscribe} - -{:then} -
+
+ {#await unsubscribe} + + {:then} {@render children()}
-
-{/await} + {:catch error} + + {/await} +