fix: race condition when changing view

This commit is contained in:
2025-09-27 20:43:14 +02:00
parent 533f358a65
commit f68cff1df4

View File

@ -82,6 +82,7 @@
let hideSearch = $state(false);
let CurrentView: Component = $state(LoadingSidebar);
let currentProps = $state({});
const modules = import.meta.glob("./sidebar/**/*.svelte");
$effect(() => {
const path =
@ -97,6 +98,7 @@
}
path().then((m) => {
CurrentView = (m as { default: Component }).default;
currentProps = view.current.props || {};
});
});
$effect(() => {
@ -220,7 +222,7 @@
{#if routing.currentTrip}
<InRouteSidebar />
{:else}
<CurrentView {...view.current.props}></CurrentView>
<CurrentView {...currentProps}></CurrentView>
{/if}
</div>
{#if !routing.currentTrip}