Only on change
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2020-07-22 21:16:38 +02:00
parent d494a7c7d6
commit e057e463bd
2 changed files with 5 additions and 7 deletions

View File

@@ -165,9 +165,7 @@ export class AppCommonEffects {
@Effect({ dispatch: false })
online$: Observable<Action> = this.actions$.pipe(
ofType(appCommonActions.ONLINE),
withLatestFrom(this.store$.select(appCommonReducers.SelectGetIsOnline)),
switchMap(([action,isOnline]) => {
if(!isOnline) {
switchMap((action) => {
console.debug("Online: Check token");
if(!this.oauthService$.hasValidAccessToken()) {
console.debug("No valid token, try to refresh");
@@ -177,7 +175,6 @@ export class AppCommonEffects {
this.store$.dispatch(new appCommonActions.InitUser());
});
}
}
}
return of(undefined);
}));