From 256718445c3cef29b92227a583b68b69b280ad9a Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Tue, 5 Nov 2024 22:06:13 +0100 Subject: [PATCH] fix activeEditor find in EditorStore refresh --- packages/project-editor/flow/editor/editor.tsx | 2 -- packages/project-editor/store/editor.ts | 9 ++++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/project-editor/flow/editor/editor.tsx b/packages/project-editor/flow/editor/editor.tsx index 36a6f1c5..d404ad2f 100644 --- a/packages/project-editor/flow/editor/editor.tsx +++ b/packages/project-editor/flow/editor/editor.tsx @@ -341,8 +341,6 @@ export const Canvas = observer( const flowContext = this.props.flowContext; - console.log(event.deltaX, event.deltaY); - let deltaX = event.deltaX; let deltaY = event.deltaY; diff --git a/packages/project-editor/store/editor.ts b/packages/project-editor/store/editor.ts index b7eadf33..a340dac6 100644 --- a/packages/project-editor/store/editor.ts +++ b/packages/project-editor/store/editor.ts @@ -324,14 +324,17 @@ export class EditorsStore { if ( parentNode && parentNode instanceof FlexLayout.TabSetNode && - ((!activeEditor && parentNode.getSelectedNode() == tab) || - (parentNode.isActive() && - parentNode.getSelectedNode() == tab)) + parentNode.isActive() && + parentNode.getSelectedNode() == tab ) { activeEditor = editor; } } + if (!activeEditor) { + activeEditor = this.activeEditor; + } + this.tabIdToEditorMap = tabIdToEditorMap; this.saveState();