fix: disregard modifiers for note selection if user hasn't triggered the action

This commit is contained in:
Antonella Sgarlatta
2021-06-02 11:20:24 -03:00
parent 26732f5b8d
commit 3823836863
3 changed files with 12 additions and 8 deletions

View File

@@ -305,7 +305,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
private async openNotesContextMenu(e: MouseEvent, note: SNNote) {
e.preventDefault();
if (!this.state.selectedNotes[note.uuid]) {
await this.selectNote(note);
await this.selectNote(note, true);
}
if (this.state.selectedNotes[note.uuid]) {
const { clientHeight } = document.documentElement;
@@ -395,8 +395,8 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
}
}
async selectNote(note: SNNote): Promise<void> {
await this.appState.notes.selectNote(note.uuid);
async selectNote(note: SNNote, userTriggered?: boolean): Promise<void> {
await this.appState.notes.selectNote(note.uuid, userTriggered);
}
async createNewNote() {