From 696f34b788f308b70ad084284e411f712d729d8e Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Tue, 25 Aug 2020 17:57:22 +0200 Subject: [PATCH] fix: use register/deregister for editors instead of activate/deactivate --- app/assets/javascripts/views/editor/editor_view.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/views/editor/editor_view.ts b/app/assets/javascripts/views/editor/editor_view.ts index 5a3b56a6f..5aeae241d 100644 --- a/app/assets/javascripts/views/editor/editor_view.ts +++ b/app/assets/javascripts/views/editor/editor_view.ts @@ -348,9 +348,9 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> { /** Unload current component view so that we create a new one */ editorUnloading: true }); - if (newEditor && !newEditor.active) { - /** Activate the new editor while the component view is unloading */ - await this.application.componentManager!.activateComponent(newEditor.uuid); + if (newEditor) { + /** Register this new editor while the editor view is reloading */ + this.application.componentManager!.registerComponent(newEditor.uuid); } await unloading; const reloading = this.setState({ @@ -358,9 +358,9 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> { editorComponent: newEditor, editorUnloading: false, }); - if (currentEditor?.active) { - /** Deactivate the current (previous) editor while the editor view is reloading */ - await this.application.componentManager!.deactivateComponent(currentEditor.uuid); + if (currentEditor) { + /** Deregister the current (previous) editor while the editor view is reloading */ + this.application.componentManager!.deregisterComponent(currentEditor.uuid); } await reloading; this.reloadFont();