fix: smart tag selection issue
This commit is contained in:
@@ -328,7 +328,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesState> {
|
|||||||
* an index is roughly O(n^2).
|
* an index is roughly O(n^2).
|
||||||
*/
|
*/
|
||||||
private reloadNotesDisplayOptions() {
|
private reloadNotesDisplayOptions() {
|
||||||
const tag = this.appState.selectedTag!;
|
const tag = this.appState.selectedTag;
|
||||||
const searchText = this.getState().noteFilter.text.toLowerCase();
|
const searchText = this.getState().noteFilter.text.toLowerCase();
|
||||||
const searchQuery = searchText ? {
|
const searchQuery = searchText ? {
|
||||||
query: searchText,
|
query: searchText,
|
||||||
@@ -337,7 +337,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesState> {
|
|||||||
const criteria = NotesDisplayCriteria.Create({
|
const criteria = NotesDisplayCriteria.Create({
|
||||||
sortProperty: this.state.sortBy! as CollectionSort,
|
sortProperty: this.state.sortBy! as CollectionSort,
|
||||||
sortDirection: this.state.sortReverse! ? 'asc' : 'dsc',
|
sortDirection: this.state.sortReverse! ? 'asc' : 'dsc',
|
||||||
tags: [tag],
|
tags: tag ? [tag] : [],
|
||||||
includeArchived: this.getState().showArchived!,
|
includeArchived: this.getState().showArchived!,
|
||||||
includePinned: !this.getState().hidePinned!,
|
includePinned: !this.getState().hidePinned!,
|
||||||
searchQuery: searchQuery
|
searchQuery: searchQuery
|
||||||
|
|||||||
@@ -246,12 +246,8 @@ class TagsViewCtrl extends PureViewCtrl<unknown, TagState> {
|
|||||||
this.selectTag(tag as SNTag);
|
this.selectTag(tag as SNTag);
|
||||||
}
|
}
|
||||||
} else if (data.item!.content_type === ContentType.SmartTag) {
|
} else if (data.item!.content_type === ContentType.SmartTag) {
|
||||||
this.application.createTemplateItem(
|
const matchingTag = this.getState().smartTags.find(t => t.uuid === data.item!.uuid);
|
||||||
ContentType.SmartTag,
|
this.selectTag(matchingTag as SNSmartTag);
|
||||||
data.item!.content as PayloadContent
|
|
||||||
).then(smartTag => {
|
|
||||||
this.selectTag(smartTag as SNSmartTag);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else if (action === ComponentAction.ClearSelection) {
|
} else if (action === ComponentAction.ClearSelection) {
|
||||||
this.selectTag(this.getState().smartTags[0]);
|
this.selectTag(this.getState().smartTags[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user