Skip to content

Commit

Permalink
Added handler for Delete hotkey, closes #427
Browse files Browse the repository at this point in the history
  • Loading branch information
RvanderLaan committed Mar 5, 2022
1 parent 53d45cc commit c8a62e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/frontend/containers/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const Main = () => {
} else if (matches(hotkeyMap.openTagEditor)) {
e.preventDefault();
uiStore.openToolbarTagPopover();
} else if (matches(hotkeyMap.deleteSelection)) {
uiStore.openMoveFilesToTrash();
}
});

Expand Down
4 changes: 3 additions & 1 deletion src/frontend/stores/UiStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ class UiStore {
}

@action.bound closeMoveFilesToTrash() {
this.isMoveFilesToTrashOpen = false;
if (this.fileSelection.size > 0) {
this.isMoveFilesToTrashOpen = false;
}
}

@action.bound toggleToolbarTagPopover() {
Expand Down

0 comments on commit c8a62e8

Please sign in to comment.