Skip to content

Commit

Permalink
fix: don't show context menu if note is protected
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonella Sgarlatta committed May 7, 2021
1 parent 02249eb commit b89cdde
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/assets/javascripts/views/notes/notes_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {

private openNotesContextMenu(e: MouseEvent, note: SNNote) {
e.preventDefault();
if (!this.state.selectedNotes[note.uuid]) {
this.selectNote(note);
this.selectNote(note);
if (!note.protected) {
this.application.getAppState().notes.setContextMenuPosition({
top: e.clientY,
left: e.clientX,
});
this.application.getAppState().notes.setContextMenuOpen(true);
}
this.application.getAppState().notes.setContextMenuPosition({
top: e.clientY,
left: e.clientX,
});
this.application.getAppState().notes.setContextMenuOpen(true);
}

private removeRightClickListeners() {
Expand Down

0 comments on commit b89cdde

Please sign in to comment.