Skip to content

Commit e9b14a2

Browse files
authored
Fix container file updating (codesandbox#2485)
1 parent 9eefb01 commit e9b14a2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ export const saveCode: AsyncAction<{
135135
state.git.isFetching = false;
136136
}
137137

138+
// If the executor is a server we only should send updates if the sandbox has been
139+
// started already
140+
if (
141+
!effects.executor.isServer() ||
142+
state.server.containerStatus === ServerContainerStatus.SANDBOX_STARTED
143+
) {
144+
effects.executor.updateFiles(state.editor.currentSandbox);
145+
}
146+
138147
if (state.live.isLive && state.live.isCurrentEditor) {
139148
effects.live.sendModuleSaved(module);
140149
}
@@ -267,15 +276,6 @@ export const setModuleCode: Action<{
267276
);
268277

269278
module.code = code;
270-
271-
// If the executor is a server we only should send updates if the sandbox has been
272-
// started already
273-
if (
274-
!effects.executor.isServer() ||
275-
state.server.containerStatus === ServerContainerStatus.SANDBOX_STARTED
276-
) {
277-
effects.executor.updateFiles(currentSandbox);
278-
}
279279
};
280280

281281
export const forkSandbox: AsyncAction<{

0 commit comments

Comments
 (0)