diff --git a/editor/src/components/editor/store/dispatch-strategies.spec.tsx b/editor/src/components/editor/store/dispatch-strategies.spec.tsx index 69d3253550f9..46afee9d3b88 100644 --- a/editor/src/components/editor/store/dispatch-strategies.spec.tsx +++ b/editor/src/components/editor/store/dispatch-strategies.spec.tsx @@ -140,7 +140,7 @@ describe('interactionCancel', () => { 'zero-drag-not-permitted', ), ) - const actualResult = interactionCancel(editorStore, dispatchResultFromEditorStore(editorStore)) + const actualResult = interactionCancel(dispatchResultFromEditorStore(editorStore)) expect(actualResult.newStrategyState.commandDescriptions).toHaveLength(0) expect(actualResult.newStrategyState.currentStrategyCommands).toHaveLength(0) expect(actualResult.newStrategyState.currentStrategy).toBeNull() diff --git a/editor/src/components/editor/store/dispatch-strategies.tsx b/editor/src/components/editor/store/dispatch-strategies.tsx index b49b3c5e3070..a9e3861a4cc0 100644 --- a/editor/src/components/editor/store/dispatch-strategies.tsx +++ b/editor/src/components/editor/store/dispatch-strategies.tsx @@ -407,22 +407,16 @@ export function interactionStart( } } -export function interactionCancel( - storedState: EditorStoreFull, - result: EditorStoreUnpatched, -): HandleStrategiesResult { - const interactionWasInProgress = interactionInProgress( - storedState.unpatchedEditor.canvas.interactionSession, - ) +export function interactionCancel(result: EditorStoreUnpatched): HandleStrategiesResult { const updatedEditorState: EditorState = { ...result.unpatchedEditor, canvas: { ...result.unpatchedEditor.canvas, interactionSession: null, }, - jsxMetadata: interactionWasInProgress ? {} : result.unpatchedEditor.jsxMetadata, - domMetadata: interactionWasInProgress ? {} : result.unpatchedEditor.domMetadata, - spyMetadata: interactionWasInProgress ? {} : result.unpatchedEditor.spyMetadata, + jsxMetadata: result.unpatchedEditor.jsxMetadata, + domMetadata: result.unpatchedEditor.domMetadata, + spyMetadata: result.unpatchedEditor.spyMetadata, } return { @@ -823,7 +817,7 @@ function handleStrategiesInner( } } else { if (cancelInteraction) { - return interactionCancel(storedState, result) + return interactionCancel(result) } else if (makeChangesPermanent) { return interactionFinished(strategies, storedState, result) } else {