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.
This commit is contained in:
Shubham Padia
2025-06-06 13:39:01 +05:30
committed by Tim Abbott
parent e5680b12f4
commit 51ff949d34

View File

@@ -1,3 +1,4 @@
import {app} from "electron/main";
import fs from "node:fs"; import fs from "node:fs";
import path from "node:path"; import path from "node:path";
import process from "node:process"; import process from "node:process";
@@ -47,6 +48,11 @@ function reloadDatabase(): void {
); );
logger.log("Error while JSON parsing global_config.json: "); logger.log("Error while JSON parsing global_config.json: ");
logger.log(error); logger.log(error);
// This function is called multiple times throughout the
// codebase, making the above dialog.showErrorBox appear
// multiple times and then leading to a non-working app.
// It might be better to quit the app instead.
app.quit();
} }
} else { } else {
configFile = false; configFile = false;