mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 04:25:08 +00:00
(Mail-ngrx) Fixed a small issue
This commit is contained in:
parent
eeed00b30e
commit
e67887f379
|
@ -138,10 +138,11 @@ export class MailsEffect
|
||||||
withLatestFrom(this.store.pipe(select(getMailsState))),
|
withLatestFrom(this.store.pipe(select(getMailsState))),
|
||||||
map(([action, state]) => {
|
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]);
|
return new MailsActions.SetCurrentMailSuccess(state.entities[this.routerState.params.mailId]);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -32,7 +32,7 @@ export class RouterEffects
|
||||||
ofType(RouterActions.GO),
|
ofType(RouterActions.GO),
|
||||||
map((action: RouterActions.Go) => action.payload),
|
map((action: RouterActions.Go) => action.payload),
|
||||||
tap(({path, query: queryParams, extras}) => {
|
tap(({path, query: queryParams, extras}) => {
|
||||||
this.router.navigate(path, {queryParams, ...extras});
|
this.router.navigate(path, {...queryParams, ...extras});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user