fix: progress on wizard popstate

This commit is contained in:
Torsten Dittmann committed 2022-11-11 10:58:36 +01:00
1 parent 9f3a267044
commit fc739940bd
1 file changed
+6 -5
+6 -5
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { afterNavigate, beforeNavigate } from '$app/navigation';
import { navigating } from '$app/stores';
let width: number;
let updater: ReturnType<typeof setTimeout>;
@@ -53,14 +53,15 @@
return 0;
}
beforeNavigate(start);
afterNavigate(complete);
$: if ($navigating) {
start();
} else {
complete();
}
$: barStyle = (width && width * 100 && `width: ${width * 100}%;`) || '';
</script>
<svelte:head />
{#if width}
<div class="progress-bar" class:progress-bar-hiding={completed} style={barStyle} />
{/if}