fix: add streamItems event listener for tags

This commit is contained in:
Antonella Sgarlatta
2021-05-26 18:03:29 -03:00
parent b0682e913b
commit 9aa2021e11

View File

@@ -65,6 +65,14 @@ export class NotesState {
}); });
}) })
); );
appEventListeners.push(
application.streamItems(
ContentType.Tag,
() => {
this.reloadActiveNoteTags();
}
)
);
} }
get activeEditor(): Editor | undefined { get activeEditor(): Editor | undefined {
@@ -344,7 +352,6 @@ export class NotesState {
} }
}); });
this.application.sync(); this.application.sync();
this.reloadActiveNoteTags();
} }
async removeTagFromSelectedNotes(tag: SNTag): Promise<void> { async removeTagFromSelectedNotes(tag: SNTag): Promise<void> {
@@ -355,7 +362,7 @@ export class NotesState {
} }
}); });
this.application.sync(); this.application.sync();
this.reloadActiveNoteTags();
} }
isTagInSelectedNotes(tag: SNTag): boolean { isTagInSelectedNotes(tag: SNTag): boolean {