AW-900
This commit is contained in:
@@ -40,10 +40,15 @@ export class AppCommonEffects {
|
||||
@Effect()
|
||||
initUser$: Observable<Action> = this.actions$.pipe(
|
||||
ofType(appCommonActions.INITUSER),
|
||||
switchMap(() => {
|
||||
withLatestFrom(this.store$.select(appCommonReducers.selectGetInitialized)),
|
||||
switchMap(([action, initialized]) => {
|
||||
if(!initialized) {
|
||||
return this.userService$.getCurrentUser().pipe(
|
||||
map((user: IUser) => new appCommonActions.InitUserSuccess(user)),
|
||||
catchError(error => of(new appCommonActions.Fail(error))))
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
|
Reference in New Issue
Block a user