fix: keep search options visible while authorizing

This commit is contained in:
Baptiste Grob
2021-03-10 16:47:37 +01:00
parent 99e26c8270
commit 24c5dba4e9
2 changed files with 10 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ type NotesState = {
}
searchIsFocused: boolean;
searchOptionsAreFocused: boolean;
authorizingSearchOptions: boolean;
mutable: { showMenu: boolean }
completedFullSync: boolean
[PrefKey.TagsPanelWidth]?: number
@@ -139,7 +140,8 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesState> {
completedFullSync: false,
hideTags: true,
searchIsFocused: false,
searchOptionsAreFocused: false
searchOptionsAreFocused: false,
authorizingSearchOptions: false
};
}
@@ -166,9 +168,15 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesState> {
this.state.noteFilter.includeProtectedNoteText = false;
} else {
event.preventDefault();
this.setState({
authorizingSearchOptions: true,
});
if (await this.application.authorizeSearchingProtectedNotesText()) {
this.state.noteFilter.includeProtectedNoteText = true;
}
this.setState({
authorizingSearchOptions: false,
});
}
this.flushUI();
}