Skip to content

Commit

Permalink
fix: handle component tag selection
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Dec 6, 2021
1 parent 8d9800d commit a9f8e1c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/assets/javascripts/views/tags/tags_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class TagsViewCtrl extends PureViewCtrl<unknown, TagState> {

registerComponentHandler() {
this.unregisterComponent =
this.application.componentManager!.registerHandler({
this.application.componentManager.registerHandler({
identifier: 'tags',
areas: [ComponentArea.TagsList],
actionHandler: (_, action, data) => {
Expand All @@ -213,7 +213,13 @@ class TagsViewCtrl extends PureViewCtrl<unknown, TagState> {
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
);
Expand Down

0 comments on commit a9f8e1c

Please sign in to comment.