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

@@ -26,8 +26,8 @@
ng-click='self.clearFilterText();', ng-click='self.clearFilterText();',
ng-show='self.state.noteFilter.text' ng-show='self.state.noteFilter.text'
) ✕ ) ✕
ng-if='self.state.searchIsFocused || self.state.searchOptionsAreFocused'
label.sk-panel-row.justify-left.mt-2( label.sk-panel-row.justify-left.mt-2(
ng-if='self.state.searchIsFocused || self.state.searchOptionsAreFocused || self.state.authorizingSearchOptions'
style="padding-bottom: 0" style="padding-bottom: 0"
) )
.sk-horizontal-group.tight .sk-horizontal-group.tight

View File

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