Skip to content

Commit b929984

Browse files
committed
Fix syncing SSE sandbox with smooth forking
1 parent 10480cc commit b929984

File tree

1 file changed

+3
-8
lines changed
  • packages/app/src/app/overmind/namespaces/files

1 file changed

+3
-8
lines changed

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -766,12 +766,9 @@ export const syncSandbox: AsyncAction<any[]> = async (
766766
if (newModule) {
767767
if (oldModule) {
768768
const modulePos = oldSandbox.modules.indexOf(oldModule);
769-
Object.assign(
770-
state.editor.sandboxes[oldSandbox.id].modules[modulePos],
771-
newModule
772-
);
769+
Object.assign(oldSandbox.modules[modulePos], newModule);
773770
} else {
774-
state.editor.sandboxes[oldSandbox.id].modules.push(newModule);
771+
oldSandbox.modules.push(newModule);
775772
}
776773
}
777774
} else if (op === 'delete' && oldModule) {
@@ -785,9 +782,7 @@ export const syncSandbox: AsyncAction<any[]> = async (
785782
// Create
786783
const newDirectory = resolveDirectoryNew(path);
787784
if (newDirectory) {
788-
state.editor.sandboxes[oldSandbox.id].directories.push(
789-
newDirectory
790-
);
785+
oldSandbox.directories.push(newDirectory);
791786
}
792787
} else {
793788
const oldDirectory = resolveDirectoryOld(path);

0 commit comments

Comments
 (0)