Skip to content

Commit fca79fe

Browse files
committed
fix: run wasm on first load
1 parent e686772 commit fca79fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/client/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ export const App = () => {
145145
}, [output]);
146146

147147
useEffect(() => {
148+
if (wasmLoadState !== "loaded") {
149+
return;
150+
}
151+
148152
getDynamicParametersOutput(debouncedCode, parameterValues)
149153
.catch((e) => {
150154
console.error(e);
@@ -155,7 +159,7 @@ export const App = () => {
155159
.then((output) => {
156160
setOutput(output);
157161
});
158-
}, [debouncedCode, parameterValues]);
162+
}, [debouncedCode, parameterValues, wasmLoadState]);
159163

160164
return (
161165
<main className="flex h-dvh w-screen flex-col items-center bg-surface-primary">

0 commit comments

Comments
 (0)