Skip to content

Commit 3108ce1

Browse files
author
Ives van Hoorne
committed
Fix double saving
1 parent b3541d1 commit 3108ce1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/app/src/app/pages/Sandbox/Editor/Content/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class EditorPreview extends React.Component<Props, State> {
212212
store.editor.pendingOperation &&
213213
store.editor.pendingOperation.map(x => x),
214214
() => {
215-
if (store.editor.pendingOperation) {
215+
if (store.editor.pendingOperation && store.live.isLive) {
216216
if (editor.setReceivingCode) {
217217
editor.setReceivingCode(true);
218218
}
@@ -247,10 +247,14 @@ class EditorPreview extends React.Component<Props, State> {
247247
const updateUserSelections = () => {
248248
if (store.editor.pendingUserSelections) {
249249
if (editor.updateUserSelections) {
250-
requestAnimationFrame(() => {
251-
editor.updateUserSelections(store.editor.pendingUserSelections);
250+
if (store.live.isLive) {
251+
requestAnimationFrame(() => {
252+
editor.updateUserSelections(store.editor.pendingUserSelections);
253+
this.props.signals.live.onSelectionDecorationsApplied();
254+
});
255+
} else {
252256
this.props.signals.live.onSelectionDecorationsApplied();
253-
});
257+
}
254258
}
255259
}
256260
};

packages/app/src/app/store/providers/KeybindingManager.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ function handleKeyDown(controller, e) {
2323
if (state.timeout) {
2424
clearTimeout(state.timeout);
2525
}
26+
if (e.defaultPrevented) {
27+
return;
28+
}
2629

2730
state.timeout = setTimeout(reset, 1500);
2831

0 commit comments

Comments
 (0)