Correction sur la mise en cache des data ref et

la vérification "AlwaysLogin"
This commit is contained in:
Sébastien André
2021-05-29 00:48:14 +02:00
parent 0027e205d0
commit 01e5417cc5
3 changed files with 28 additions and 20 deletions

View File

@@ -30,22 +30,14 @@ export class AppComponent implements OnInit {
private authenticationService: AuthenticationService,
private serviceComm: ServiceComm,
private serviceCacheApi : ServiceCacheApi,
private translateService: TranslateService,
private serviceApiAircraft : AircraftService,
private serviceApiJumpType : JumpTypeService,
private serviceApiDropzone : DropzoneService,
private serviceApiGear : GearService)
private translateService: TranslateService)
{
this.authenticationService.alwaysLogin();
this.authenticationService.currentUser.subscribe(user => {
if (user) {
this.currentUser = user;
this.translateService.addLangs(['en', 'fr']);
this.translateService.use(user.language);
this.selectedLanguageFlag = user.language;
this.putToCacheRefDatas().subscribe(() => { console.log("Push to cache the referentiel datas"); });
}
});
@@ -77,13 +69,4 @@ export class AppComponent implements OnInit {
this.authenticationService.currentUserValue = this.currentUser;
this.selectedLanguageFlag = event.value;
}
private putToCacheRefDatas(): Observable<any[]> {
var aircraftResp = this.serviceApiAircraft.getListOfAircrafts(false);
var jumpTypeResp = this.serviceApiJumpType.getListOfJumpTypes();
var dzResp = this.serviceApiDropzone.getListOfDropZones(false);
var gearResp = this.serviceApiGear.getListOfGears();
return forkJoin([aircraftResp, jumpTypeResp, dzResp, gearResp]);
}
}