Skip to content

Commit

Permalink
fix: adjust shortcuts and unregister on inbox destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Aug 9, 2024
1 parent a0c1185 commit 8a2ce3b
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/app/units/states/tasks/inbox/inbox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ export class InboxComponent implements OnInit, OnDestroy {
});
}

if (!registeredHotkeys.includes('control.shift.r')) {
this.hotkeys
.addShortcut({
keys: 'control.shift.r',
description: 'Mark selected task as redo',
})
.subscribe(() => this.selectedTask.selectedTask?.updateTaskStatus('redo'));
}

if (!registeredHotkeys.includes('control.shift.f')) {
this.hotkeys
.addShortcut({
Expand All @@ -100,7 +91,7 @@ export class InboxComponent implements OnInit, OnDestroy {
.subscribe(() => this.selectedTask.selectedTask?.updateTaskStatus('fix_and_resubmit'));
}

if (!registeredHotkeys.includes('altleft.shift.c')) {
if (!registeredHotkeys.includes('control.shift.c')) {
this.hotkeys
.addShortcut({
keys: 'control.Shift.c',
Expand Down Expand Up @@ -152,8 +143,10 @@ export class InboxComponent implements OnInit, OnDestroy {
}

ngOnDestroy(): void {
this.hotkeys.removeShortcuts('control.shift.arrowdown');
this.hotkeys.removeShortcuts('control.shift.arrowup');
this.hotkeys.removeShortcuts('control.shift.d');
this.hotkeys.removeShortcuts('control.shift.f');
this.hotkeys.removeShortcuts('control.shift.c');
this.hotkeys.removeShortcuts('shift.?');
}

startedDragging(event: CdkDragStart, div: HTMLDivElement) {
Expand Down

0 comments on commit 8a2ce3b

Please sign in to comment.