Skip to content

Commit

Permalink
SDA-4247 & SDA-4270 (Add logic to wait for config write to complete) (f…
Browse files Browse the repository at this point in the history
…inos#1936)

* SDA-4247 - wait for config write to complete

Signed-off-by: Kiran Niranjan <kiran.niranjan@symphony.com>

* SDA-4247 - wait for config write to complete

Signed-off-by: Kiran Niranjan <kiran.niranjan@symphony.com>

---------

Signed-off-by: Kiran Niranjan <kiran.niranjan@symphony.com>
  • Loading branch information
KiranNiranjan authored and sbenmoussati committed Aug 18, 2023
1 parent 83508c2 commit 61f6987
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/config-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class Config {
public cloudConfig: ICloudConfig | {};
public filteredCloudConfig: ICloudConfig | {};
private isFirstTime: boolean = true;
private didUpdateConfigFile: boolean = false;
private installVariant: string | undefined;
private bootCount: number | undefined;
private readonly configFileName: string;
Expand Down Expand Up @@ -220,7 +221,14 @@ class Config {
this.readInstallVariant();
this.readCloudConfig();

app.on('before-quit', this.writeUserConfig);
app.on('before-quit', async (event) => {
if (!this.didUpdateConfigFile) {
event.preventDefault();
await this.writeUserConfig();
this.didUpdateConfigFile = true;
app.quit();
}
});
}

/**
Expand Down

0 comments on commit 61f6987

Please sign in to comment.