Skip to content

Commit 57a5d4c

Browse files
fix issue with deleting template (codesandbox#3705)
1 parent 64d4725 commit 57a5d4c

File tree

1 file changed

+2
-3
lines changed
  • packages/app/src/app/overmind/namespaces/workspace

1 file changed

+2
-3
lines changed

packages/app/src/app/overmind/namespaces/workspace/actions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,11 @@ export const deleteTemplate: AsyncAction = async ({
360360
) {
361361
return;
362362
}
363-
const sandboxId = state.editor.currentSandbox.id;
363+
const sandbox = state.editor.currentSandbox;
364364
const templateId = state.editor.currentSandbox.customTemplate.id;
365365

366366
try {
367-
await effects.api.deleteTemplate(sandboxId, templateId);
368-
const sandbox = state.editor.sandboxes[sandboxId];
367+
await effects.api.deleteTemplate(sandbox.id, templateId);
369368

370369
sandbox.isFrozen = false;
371370
sandbox.customTemplate = null;

0 commit comments

Comments
 (0)