Skip to content

Commit 51ff949

Browse files
shubham-padiatimabbott
authored andcommitted
enterprise: Quit app after showing error for invalid global config.
Otherwise, the error will keep showing multiple times ultimately leading to a non-working app after multiple errors.
1 parent e5680b1 commit 51ff949

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/common/enterprise-util.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {app} from "electron/main";
12
import fs from "node:fs";
23
import path from "node:path";
34
import process from "node:process";
@@ -47,6 +48,11 @@ function reloadDatabase(): void {
4748
);
4849
logger.log("Error while JSON parsing global_config.json: ");
4950
logger.log(error);
51+
// This function is called multiple times throughout the
52+
// codebase, making the above dialog.showErrorBox appear
53+
// multiple times and then leading to a non-working app.
54+
// It might be better to quit the app instead.
55+
app.quit();
5056
}
5157
} else {
5258
configFile = false;

0 commit comments

Comments
 (0)