From d774ecb3e13a1f4ae1bbc3f3b685ed40955721b0 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Thu, 2 Jul 2020 13:00:38 +0200 Subject: [PATCH] fix: load/unload tags component on change --- app/assets/javascripts/views/editor/editor_view.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/assets/javascripts/views/editor/editor_view.ts b/app/assets/javascripts/views/editor/editor_view.ts index 90dc822c4..2097c4a8e 100644 --- a/app/assets/javascripts/views/editor/editor_view.ts +++ b/app/assets/javascripts/views/editor/editor_view.ts @@ -387,6 +387,7 @@ class EditorViewCtrl extends PureViewCtrl implements EditorViewScope { } /** Reload componentStack in case new ones were added or removed */ await this.reloadComponentStack(); + this.reloadNoteTagsComponent(); /** Observe editor changes to see if the current note should update its editor */ const editors = components.filter((component) => { return component.isEditor(); @@ -1109,6 +1110,18 @@ class EditorViewCtrl extends PureViewCtrl implements EditorViewScope { }); } + reloadNoteTagsComponent() { + const components = this.application.componentManager! + .componentsForArea(ComponentArea.NoteTags); + for (const component of components) { + if (component.active) { + this.componentGroup.activateComponent(component); + } else { + this.componentGroup.deactivateComponent(component); + } + } + } + async reloadComponentStack() { const components = this.application.componentManager! .componentsForArea(ComponentArea.EditorStack)