fix: hide wizard on navigation

This commit is contained in:
Torsten Dittmann committed 2022-09-21 19:25:16 +02:00
1 parent 87133bb252
commit 7c4dd869a2
3 files changed
+6 -2

No files matched your search

-1
View File
@@ -4,7 +4,6 @@
export let currentSub = 0;
export let isSub = false;
export let step: { text: string; substeps?: { text: string }[] };
console.log({ step, completed, current });
</script>
<li
+5
View File
@@ -9,6 +9,7 @@
</script>
<script lang="ts">
import { beforeNavigate } from '$app/navigation';
import { Steps } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { wizard } from '$lib/stores/wizard';
@@ -39,6 +40,10 @@
$: sortedSteps = [...steps].sort(([a], [b]) => (a > b ? 1 : -1));
$: isLastStep = currentStep === steps.size;
beforeNavigate(() => {
wizard.hide();
});
</script>
<svelte:window on:keydown={handleKeydown} />
@@ -57,7 +57,7 @@
};
onDestroy(() => {
$createDocument.document = {};
initializeDocument();
$createDocument.read = [];
$createDocument.write = [];
});