Skip to content

Commit 81dd93b

Browse files
use currentId when merging in fork data (codesandbox#3786)
* use currentId when merging in fork data * Fix typecheck Co-authored-by: Ives van Hoorne <[email protected]>
1 parent dba5597 commit 81dd93b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/app/src/app/overmind/namespaces/editor/internalActions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ export const forkSandbox: AsyncAction<{
370370
return;
371371
}
372372

373+
const currentSandboxId = state.editor.currentId;
374+
373375
effects.analytics.track('Fork Sandbox');
374376

375377
try {
@@ -401,7 +403,7 @@ export const forkSandbox: AsyncAction<{
401403
state.workspace.project.description = forkedSandbox.description || '';
402404
state.workspace.project.alias = forkedSandbox.alias || '';
403405

404-
Object.assign(state.editor.sandboxes[sandbox.id], forkedSandbox);
406+
Object.assign(state.editor.sandboxes[currentSandboxId]!, forkedSandbox);
405407
state.editor.modulesByPath = effects.vscode.sandboxFsSync.create(
406408
forkedSandbox
407409
);

0 commit comments

Comments
 (0)