refactor: use setState
This commit is contained in:
@@ -706,7 +706,12 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesState> {
|
|||||||
async onIncludeProtectedNoteTextChange(event: Event) {
|
async onIncludeProtectedNoteTextChange(event: Event) {
|
||||||
this.searchBarInput?.[0].focus();
|
this.searchBarInput?.[0].focus();
|
||||||
if (this.state.noteFilter.includeProtectedNoteText) {
|
if (this.state.noteFilter.includeProtectedNoteText) {
|
||||||
this.state.noteFilter.includeProtectedNoteText = false;
|
await this.setState({
|
||||||
|
noteFilter: {
|
||||||
|
...this.state.noteFilter,
|
||||||
|
includeProtectedNoteText: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
this.reloadNotesDisplayOptions();
|
this.reloadNotesDisplayOptions();
|
||||||
await this.reloadNotes();
|
await this.reloadNotes();
|
||||||
} else {
|
} else {
|
||||||
@@ -715,7 +720,12 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesState> {
|
|||||||
});
|
});
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (await this.application.authorizeSearchingProtectedNotesText()) {
|
if (await this.application.authorizeSearchingProtectedNotesText()) {
|
||||||
this.state.noteFilter.includeProtectedNoteText = true;
|
await this.setState({
|
||||||
|
noteFilter: {
|
||||||
|
...this.state.noteFilter,
|
||||||
|
includeProtectedNoteText: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
this.reloadNotesDisplayOptions();
|
this.reloadNotesDisplayOptions();
|
||||||
await this.reloadNotes();
|
await this.reloadNotes();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user