fix: view note on protected notes warning not dismissing warning
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#editor-column.section.editor.sn-component(aria-label='Note')
|
||||
protected-note-panel.h-full.flex.justify-center.items-center(
|
||||
ng-if='self.appState.notes.showProtectedWarning'
|
||||
ng-if='self.state.showProtectedWarning'
|
||||
app-state='self.appState'
|
||||
on-view-note='self.dismissProtectedWarning()'
|
||||
)
|
||||
|
||||
@@ -73,6 +73,7 @@ type EditorState = {
|
||||
/** Setting to true then false will allow the main content textarea to be destroyed
|
||||
* then re-initialized. Used when reloading spellcheck status. */
|
||||
textareaUnloading: boolean;
|
||||
showProtectedWarning: boolean;
|
||||
};
|
||||
|
||||
type EditorValues = {
|
||||
@@ -199,6 +200,11 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
||||
}
|
||||
}
|
||||
});
|
||||
this.autorun(() => {
|
||||
this.setState({
|
||||
showProtectedWarning: this.appState.notes.showProtectedWarning
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** @override */
|
||||
@@ -216,6 +222,7 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
||||
noteStatus: undefined,
|
||||
editorUnloading: false,
|
||||
textareaUnloading: false,
|
||||
showProtectedWarning: false,
|
||||
} as EditorState;
|
||||
}
|
||||
|
||||
@@ -607,7 +614,7 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
||||
}
|
||||
|
||||
setShowProtectedWarning(show: boolean) {
|
||||
this.application.getAppState().notes.setShowProtectedWarning(show);
|
||||
this.appState.notes.setShowProtectedWarning(show);
|
||||
}
|
||||
|
||||
async deleteNote(permanently: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user