From a9f8e1cba6d3da1b2d8e68b684bf5b4f17968a49 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Mon, 6 Dec 2021 13:20:45 -0600 Subject: [PATCH] fix: handle component tag selection --- app/assets/javascripts/views/tags/tags_view.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/views/tags/tags_view.ts b/app/assets/javascripts/views/tags/tags_view.ts index 4bd6f721d..cd19ff1f0 100644 --- a/app/assets/javascripts/views/tags/tags_view.ts +++ b/app/assets/javascripts/views/tags/tags_view.ts @@ -202,7 +202,7 @@ class TagsViewCtrl extends PureViewCtrl { registerComponentHandler() { this.unregisterComponent = - this.application.componentManager!.registerHandler({ + this.application.componentManager.registerHandler({ identifier: 'tags', areas: [ComponentArea.TagsList], actionHandler: (_, action, data) => { @@ -213,7 +213,13 @@ class TagsViewCtrl extends PureViewCtrl { return; } - if (item.content_type === ContentType.SmartTag) { + if (item.content_type === ContentType.Tag) { + const matchingTag = this.application.findItem(item.uuid); + + if (matchingTag) { + this.selectTag(matchingTag as SNTag); + } + } else if (item.content_type === ContentType.SmartTag) { const matchingTag = this.getState().smartTags.find( (t) => t.uuid === item.uuid );