Skip to content

Commit

Permalink
Fix race with importing before WASM is done
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Mar 20, 2024
1 parent 0893453 commit 08f5a07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion web/src/lane-editor/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import RenderLaneMarkings from "../common/layers/RenderLaneMarkings.svelte";
import RenderLanePolygons from "../common/layers/RenderLanePolygons.svelte";
let wasmReady = false;
onMount(async () => {
await init();
wasmReady = true;
});
let way: bigint | null = null;
Expand Down Expand Up @@ -54,7 +56,9 @@
</p>
<hr />

<ImportControls />
{#if wasmReady}
<ImportControls />
{/if}
<hr />

<EditWayControls {way} />
Expand Down
6 changes: 5 additions & 1 deletion web/src/street-explorer/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
import IntersectionPopup from "./IntersectionPopup.svelte";
import LanePopup from "./LanePopup.svelte";
let wasmReady = false;
onMount(async () => {
await init();
wasmReady = true;
});
// Some of the layer contents need to be under the Map component for Svelte
Expand Down Expand Up @@ -53,7 +55,9 @@

<hr />

<ImportControls />
{#if wasmReady}
<ImportControls />
{/if}

<br />

Expand Down

0 comments on commit 08f5a07

Please sign in to comment.