diff --git a/src/app/main/apps/mail-ngrx/store/effects/mails.effects.ts b/src/app/main/apps/mail-ngrx/store/effects/mails.effects.ts index 3e3cddf1..b24a85a5 100644 --- a/src/app/main/apps/mail-ngrx/store/effects/mails.effects.ts +++ b/src/app/main/apps/mail-ngrx/store/effects/mails.effects.ts @@ -138,10 +138,11 @@ export class MailsEffect withLatestFrom(this.store.pipe(select(getMailsState))), map(([action, state]) => { - if ( !state.entities[this.routerState.params.mailId] ) + if ( this.routerState.params.mailId && !state.entities[this.routerState.params.mailId] ) { - return new fromRoot.Go({path: [this.routerState.url.replace(this.routerState.params.mailId, '')]}); + // return new fromRoot.Go({path: [this.routerState.url.replace(this.routerState.params.mailId, '')]}); } + return new MailsActions.SetCurrentMailSuccess(state.entities[this.routerState.params.mailId]); }) ); diff --git a/src/app/store/effects/router.effect.ts b/src/app/store/effects/router.effect.ts index ad3d9546..88a865b6 100644 --- a/src/app/store/effects/router.effect.ts +++ b/src/app/store/effects/router.effect.ts @@ -32,7 +32,7 @@ export class RouterEffects ofType(RouterActions.GO), map((action: RouterActions.Go) => action.payload), tap(({path, query: queryParams, extras}) => { - this.router.navigate(path, {queryParams, ...extras}); + this.router.navigate(path, {...queryParams, ...extras}); }) );