Skip to content

Commit 781ce10

Browse files
committed
Fix ignored updates
1 parent 562f65a commit 781ce10

File tree

1 file changed

+1
-6
lines changed
  • packages/common/src/components/Preview

1 file changed

+1
-6
lines changed

packages/common/src/components/Preview/index.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ class BasePreview extends React.Component<Props, State> {
153153
lastSent: {
154154
sandboxId: string;
155155
modules: IModulesByPath;
156-
ignoreNextUpdate: boolean;
157156
};
158157

159158
$socket: SocketIOClient.Socket;
@@ -211,7 +210,6 @@ class BasePreview extends React.Component<Props, State> {
211210
this.lastSent = {
212211
sandboxId: this.props.sandbox.id,
213212
modules: this.getModulesToSend(),
214-
ignoreNextUpdate: false,
215213
};
216214
};
217215

@@ -313,8 +311,6 @@ class BasePreview extends React.Component<Props, State> {
313311
});
314312

315313
socket.on('sandbox:update', message => {
316-
this.lastSent.ignoreNextUpdate = true;
317-
318314
if (this.props.syncSandbox) {
319315
this.props.syncSandbox({ updates: message.updates });
320316
}
@@ -608,8 +604,7 @@ class BasePreview extends React.Component<Props, State> {
608604

609605
this.lastSent.modules = modulesToSend;
610606

611-
const ignoreUpdate = this.lastSent.ignoreNextUpdate;
612-
if (!ignoreUpdate && Object.keys(diff).length > 0 && this.$socket) {
607+
if (Object.keys(diff).length > 0 && this.$socket) {
613608
this.$socket.emit('sandbox:update', diff);
614609
}
615610
this.lastSent.ignoreNextUpdate = false;

0 commit comments

Comments
 (0)