diff --git a/src/store/effects/keymap.ts b/src/store/effects/keymap.ts index 73e48062..40b4620f 100644 --- a/src/store/effects/keymap.ts +++ b/src/store/effects/keymap.ts @@ -24,6 +24,15 @@ export class KeymapEffects { this.router.navigate(['/keymap', entities[entities.length - 1].abbreviation]); }); + @Effect({ dispatch: false }) duplicate$: any = this.actions$ + .ofType(KeymapActions.DUPLICATE) + .withLatestFrom(this.store) + .do((latest) => { + const state: AppState = latest[1]; + const entities: Keymap[] = state.keymaps.entities; + this.router.navigate(['/keymap', entities[entities.length - 1].abbreviation]); + }); + @Effect({ dispatch: false })remove$: any = this.actions$ .ofType(KeymapActions.REMOVE) .withLatestFrom(this.store)