fix: don't show context menu if note is protected

This commit is contained in:
Antonella Sgarlatta
2021-05-07 15:59:09 -03:00
parent 02249ebaca
commit b89cdde1fc

View File

@@ -300,15 +300,15 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
private openNotesContextMenu(e: MouseEvent, note: SNNote) { private openNotesContextMenu(e: MouseEvent, note: SNNote) {
e.preventDefault(); e.preventDefault();
if (!this.state.selectedNotes[note.uuid]) {
this.selectNote(note); this.selectNote(note);
} if (!note.protected) {
this.application.getAppState().notes.setContextMenuPosition({ this.application.getAppState().notes.setContextMenuPosition({
top: e.clientY, top: e.clientY,
left: e.clientX, left: e.clientX,
}); });
this.application.getAppState().notes.setContextMenuOpen(true); this.application.getAppState().notes.setContextMenuOpen(true);
} }
}
private removeRightClickListeners() { private removeRightClickListeners() {
for (const [noteUuid, listener] of this.rightClickListeners.entries()) { for (const [noteUuid, listener] of this.rightClickListeners.entries()) {