diff --git a/src/app/app.component.ts b/src/app/app.component.ts index d16c10fba4478b452ed648ba1babe831b9e0dd39..41b91040f44dd89337631324000e30c55925a48c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -478,7 +478,9 @@ export class AppComponent implements OnInit, OnDestroy, Observer { if (data.hasErrors) { this.notificationsService.notify(this.intlService.localizeText("ERROR_PROBLEM_LOADING_SESSION"), 3500); } else { - this.toFirstCalc(); + if (data.loaded && data.loaded.length > 0) { + this.toCalc(data.loaded[0]); + } } }) .catch((err) => { diff --git a/src/app/services/formulaire/formulaire.service.ts b/src/app/services/formulaire/formulaire.service.ts index 97016de31a93512fa5f8082189bb358580ad8321..a9db2718d8db25e77fe8c79d6b5c20d1086c14e1 100644 --- a/src/app/services/formulaire/formulaire.service.ts +++ b/src/app/services/formulaire/formulaire.service.ts @@ -558,7 +558,7 @@ export class FormulaireService extends Observable { * @param f fichier session * @param formInfos infos sur les modules de calcul @see DialogLoadSessionComponent.calculators */ - public async loadSession(f: File, formInfos: any[]): Promise<{ hasErrors: boolean }> { + public async loadSession(f: File, formInfos: any[]): Promise<{ hasErrors: boolean, loaded: string[] }> { try { const s = await this.readSingleFile(f); const uids: string[] = []; @@ -582,7 +582,8 @@ export class FormulaireService extends Observable { } // forward errors return { - hasErrors: res.hasErrors + hasErrors: res.hasErrors, + loaded: newNubs.map(n => n.nub.uid) }; } catch (err) {