diff --git a/app/assets/javascripts/views/notes/notes_view.ts b/app/assets/javascripts/views/notes/notes_view.ts index 9d71f391b..5eee017f7 100644 --- a/app/assets/javascripts/views/notes/notes_view.ts +++ b/app/assets/javascripts/views/notes/notes_view.ts @@ -706,7 +706,12 @@ class NotesViewCtrl extends PureViewCtrl { async onIncludeProtectedNoteTextChange(event: Event) { this.searchBarInput?.[0].focus(); if (this.state.noteFilter.includeProtectedNoteText) { - this.state.noteFilter.includeProtectedNoteText = false; + await this.setState({ + noteFilter: { + ...this.state.noteFilter, + includeProtectedNoteText: false, + }, + }); this.reloadNotesDisplayOptions(); await this.reloadNotes(); } else { @@ -715,7 +720,12 @@ class NotesViewCtrl extends PureViewCtrl { }); event.preventDefault(); if (await this.application.authorizeSearchingProtectedNotesText()) { - this.state.noteFilter.includeProtectedNoteText = true; + await this.setState({ + noteFilter: { + ...this.state.noteFilter, + includeProtectedNoteText: true, + }, + }); this.reloadNotesDisplayOptions(); await this.reloadNotes(); }