AW-1431 Add InitUserSettingsRoot
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -81,12 +81,36 @@ export class AppCommonEffects {
|
||||
return [];
|
||||
})
|
||||
);
|
||||
|
||||
@Effect()
|
||||
initUserSettingsRoot$:Observable<Action> = this.actions$.pipe(
|
||||
ofType(appCommonActions.INITUSERSETTINGSROOT),
|
||||
withLatestFrom(this.store$.select(appCommonReducers.SelectGetUser)),
|
||||
switchMap(([, user]) => {
|
||||
return this.itemService$.getItem(user.code + ':USER_SETTINGS').pipe(
|
||||
switchMap((item) => of(new appCommonActions.InitUserSettingsRootSuccess(item))),
|
||||
catchError(error => of(new appCommonActions.Fail(error)))
|
||||
)
|
||||
})
|
||||
);
|
||||
|
||||
@Effect()
|
||||
initUserSettingsRootChanged$:Observable<Action> = this.actions$.pipe(
|
||||
ofType(appCommonActions.ITEMCHANGEDEVENT),
|
||||
switchMap((action) => {
|
||||
let a = action as appCommonActions.ItemChangedEvent;
|
||||
if(a.itemCode.endsWith(":USER_SETTINGS"))
|
||||
return of(new appCommonActions.InitUserSettingsRoot());
|
||||
else
|
||||
return [];
|
||||
})
|
||||
);
|
||||
|
||||
@Effect()
|
||||
initUserSuccess$: Observable<Action> = this.actions$.pipe(
|
||||
ofType(appCommonActions.INITUSERSUCCESS),
|
||||
switchMap(() => {
|
||||
return [new appCommonActions.InitRoot(),new appCommonActions.InitUserPackages()];
|
||||
return [new appCommonActions.InitRoot(),new appCommonActions.InitUserPackages(),new appCommonActions.InitUserSettingsRoot()];
|
||||
}
|
||||
));
|
||||
|
||||
|
Reference in New Issue
Block a user