Skip to content

Commit c2821d5

Browse files
Make sure saving a file is indicated correctly in VSCode during live
1 parent 560f417 commit c2821d5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const setModuleSavedCode: Action<{
7777
captureException(new Error('SETTING UNDEFINED SAVEDCODE'));
7878
}
7979

80-
module.savedCode = savedCode;
80+
module.savedCode = module.code === savedCode ? null : savedCode;
8181
}
8282
};
8383

packages/app/src/app/overmind/namespaces/live/liveMessageOperators.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ export const onModuleSaved: Operator<LiveMessage<{
122122
});
123123

124124
effects.vscode.sandboxFsSync.writeFile(state.editor.modulesByPath, module);
125+
// We revert the module so that VSCode will flag saved indication correctly
126+
effects.vscode.revertModule(module);
125127
actions.editor.internal.updatePreviewCode();
126128
});
127129

0 commit comments

Comments
 (0)