We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0045a4 commit d355a8fCopy full SHA for d355a8f
1 file changed
src/routes/+page.svelte
@@ -705,19 +705,20 @@
705
// Prevent concurrent simulation runs (synchronous check for rapid key presses)
706
if (simRunning || isRunStarting || pyodideLoading) return;
707
708
+ // Set flag before any async operations to prevent race conditions
709
+ isRunStarting = true;
710
+
711
// Auto-initialize if not ready
712
if (!pyodideReady) {
713
try {
714
await initPyodide();
715
} catch (error) {
716
console.error('Failed to initialize Pyodide:', error);
717
+ isRunStarting = false;
718
return;
719
}
720
721
- // Set flag synchronously to prevent race conditions during validation
- isRunStarting = true;
-
722
723
// Run simulation
724
const { nodes, connections } = graphStore.toJSON();
0 commit comments