unsubscribe Mousetrap on selection service destruction

pull/7547/head
Oliver Günther 5 years ago
parent 52a4185001
commit 22a22b161d
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 8
      frontend/src/app/components/wp-fast-table/state/wp-table-selection.service.ts
  2. 2
      frontend/src/app/components/wp-fast-table/state/wp-view-display-representation.service.ts

@ -2,14 +2,14 @@ import {WPTableRowSelectionState} from '../wp-table.interfaces';
import {input} from 'reactivestates';
import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";
import {WorkPackageCacheService} from 'core-components/work-packages/work-package-cache.service';
import {Injectable, Injector} from '@angular/core';
import {Injectable, Injector, OnDestroy} from '@angular/core';
import {WorkPackageResource} from 'core-app/modules/hal/resources/work-package-resource';
import {States} from 'core-components/states.service';
import {OPContextMenuService} from "core-components/op-context-menu/op-context-menu.service";
import {RenderedWorkPackage} from "core-app/modules/work_packages/render-info/rendered-work-package.type";
@Injectable()
export class WorkPackageTableSelection {
export class WorkPackageTableSelection implements OnDestroy {
private selectionState = input<WPTableRowSelectionState>();
@ -20,6 +20,10 @@ export class WorkPackageTableSelection {
this.reset();
}
ngOnDestroy():void {
Mousetrap.unbind(['command+d', 'ctrl+d']);
Mousetrap.unbind(['command+a', 'ctrl+a']);
}
public isSelected(workPackageId:string) {
return this.currentState.selected[workPackageId];

@ -41,7 +41,7 @@ export const wpDisplayCardRepresentation:string = 'card';
export type wpDisplayRepresentation = 'list'|'card';
@Injectable()
export class WorkPackageDisplayRepresentationService extends WorkPackageQueryStateService<string|null> {
export class WorkPackageViewDisplayRepresentationService extends WorkPackageQueryStateService<string|null> {
public constructor(readonly states:States,
readonly querySpace:IsolatedQuerySpace) {
super(querySpace);

Loading…
Cancel
Save