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