Skip to content

Commit c281f04

Browse files
fix selectint a saved deleted file in VSCode
1 parent 7c0218d commit c281f04

File tree

1 file changed

+11
-0
lines changed
  • packages/app/src/app/overmind/namespaces/files

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,17 @@ export const massCreateModules: AsyncAction<{
446446

447447
actions.editor.internal.updatePreviewCode();
448448

449+
// This can happen if you have selected a deleted file in VSCode and try to save it,
450+
// we want to select it again
451+
if (!state.editor.currentModuleShortid) {
452+
const lastAddedModule =
453+
state.editor.currentSandbox.modules[
454+
state.editor.currentSandbox.modules.length - 1
455+
];
456+
457+
actions.editor.internal.setCurrentModule(lastAddedModule);
458+
}
459+
449460
if (state.live.isCurrentEditor) {
450461
effects.live.sendMassCreatedModules(data.modules, data.directories);
451462
}

0 commit comments

Comments
 (0)