Skip to content

Commit

Permalink
fix: force destroy wallet page (#1834)
Browse files Browse the repository at this point in the history
# Motivation

For the same SvelteKit issue as for the "Login" page we noticed that on destroy of the CkBTCWallet page was not called. 
This fixes the issue for that particular page. We might want to have  a look to apply it to all routes later.

# Issues

SvelteKit issue sveltejs/kit#5434

# Changes

- destroy layout and all children on navigation to "force" the destroy of the components
  • Loading branch information
peterpeterparker authored Feb 7, 2023
1 parent 49ae117 commit f8a372c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions frontend/src/routes/(app)/(u)/(detail)/wallet/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
import Content from "$lib/components/layout/Content.svelte";
import { goto } from "$app/navigation";
import { accountsPathStore } from "$lib/derived/paths.derived";
import { isNullish } from "$lib/utils/utils";
import { navigating } from "$app/stores";
const back = (): Promise<void> => goto($accountsPathStore);
</script>

<Layout>
<Content {back}>
<slot />
</Content>
</Layout>
<!-- Workaround for SvelteKit issue https://github.com/sveltejs/kit/issues/5434 -->
{#if isNullish($navigating)}
<Layout>
<Content {back}>
<slot />
</Content>
</Layout>
{/if}

0 comments on commit f8a372c

Please sign in to comment.