Skip to content

Commit 6a63ae0

Browse files
committed
Fix parallel sandboxes running
1 parent e41f883 commit 6a63ae0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/app/src/sandbox/compile.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,16 @@ async function compile({
344344
});
345345

346346
try {
347-
if (localStorage.getItem('running')) {
347+
// We set it as a time value for people that run two sandboxes on one computer
348+
// they execute at the same time and we don't want them to conflict, so we check
349+
// if the message was set a second ago
350+
if (Date.now() < localStorage.getItem('running') > 1000) {
348351
localStorage.removeItem('running');
349352
showRunOnClick();
350353
return;
351354
}
352355

353-
localStorage.setItem('running', 'true');
356+
localStorage.setItem('running', Date.now());
354357
} catch (e) {
355358
/* no */
356359
}

0 commit comments

Comments
 (0)