fix: smart tag selection issue

This commit is contained in:
Mo Bitar
2021-03-06 11:25:12 -06:00
parent 01c35e46a5
commit af1a369e63
2 changed files with 4 additions and 8 deletions

View File

@@ -328,7 +328,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesState> {
* an index is roughly O(n^2).
*/
private reloadNotesDisplayOptions() {
const tag = this.appState.selectedTag!;
const tag = this.appState.selectedTag;
const searchText = this.getState().noteFilter.text.toLowerCase();
const searchQuery = searchText ? {
query: searchText,
@@ -337,7 +337,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesState> {
const criteria = NotesDisplayCriteria.Create({
sortProperty: this.state.sortBy! as CollectionSort,
sortDirection: this.state.sortReverse! ? 'asc' : 'dsc',
tags: [tag],
tags: tag ? [tag] : [],
includeArchived: this.getState().showArchived!,
includePinned: !this.getState().hidePinned!,
searchQuery: searchQuery