Files
agent/packages/uhk-web/src/app/components/uhk-header/uhk-header.ts
Róbert Kiss 1a413c824e Fix 560 delete bind play macro action when macro delete (#576)
* fix(config): delete KeyAction binding of deleted macro

* refactor: use sorter import

* fix(macro): read the macro id from route params

* fix(keyAction): use NoneAction in keyAction mapping
2018-02-11 20:12:12 +01:00

30 lines
924 B
TypeScript

import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { Notification } from 'uhk-common';
import { AppState, getUndoableNotification } from '../../store';
import { DismissUndoNotificationAction, UndoLastAction } from '../../store/actions/app';
@Component({
selector: 'uhk-header',
templateUrl: './uhk-header.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class UhkHeader {
undoableNotification$: Observable<Notification>;
constructor(private store: Store<AppState>) {
this.undoableNotification$ = this.store.select(getUndoableNotification);
}
onUndoLastNotification(data: any): void {
this.store.dispatch(new UndoLastAction(data));
}
onDismissLastNotification(): void {
this.store.dispatch(new DismissUndoNotificationAction());
}
}