From aaa40a9def81b3d7f25403ccd78d2aca91230f5a Mon Sep 17 00:00:00 2001 From: Shubham Padia Date: Wed, 18 Jun 2025 17:12:07 +0530 Subject: [PATCH] enterprise-util: Do not use app.quit() in case of renderer process. For renderer process, we will call `ipcRenderer.send("quit-app")` instead. --- app/common/enterprise-util.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/common/enterprise-util.ts b/app/common/enterprise-util.ts index 81d543ab9..a736b15fe 100644 --- a/app/common/enterprise-util.ts +++ b/app/common/enterprise-util.ts @@ -6,6 +6,8 @@ import process from "node:process"; import {z} from "zod"; import {dialog} from "zulip:remote"; +import {ipcRenderer} from "../renderer/js/typed-ipc-renderer.js"; + import {enterpriseConfigSchemata} from "./config-schemata.js"; import Logger from "./logger-util.js"; @@ -52,7 +54,11 @@ function reloadDatabase(): void { // 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(); + if (process.type === "renderer") { + ipcRenderer.send("quit-app"); + } else { + app.quit(); + } } } else { configFile = false;