Defer settings/certificates load until app ready.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2022-08-05 16:24:52 +02:00
committed by Akos Kitta
parent 92bc5ecf7b
commit 7a3e6789d1
2 changed files with 15 additions and 7 deletions

View File

@@ -111,9 +111,11 @@ export class SettingsService {
@postConstruct()
protected async init(): Promise<void> {
const settings = await this.loadSettings();
this._settings = deepClone(settings);
this.ready.resolve();
this.appStateService.reachedState('ready').then(async () => {
const settings = await this.loadSettings();
this._settings = deepClone(settings);
this.ready.resolve();
});
}
protected async loadSettings(): Promise<Settings> {