From 534b1d18f9375ca8cdc8b3b06d0ad46c516d8c12 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Fri, 11 Oct 2024 17:16:59 -0300 Subject: [PATCH] electron: Fix problem of window going blank during hot reload --- electron/main.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/electron/main.ts b/electron/main.ts index f1f527c60..0454c4917 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -61,3 +61,10 @@ protocol.registerSchemesAsPrivileged([ ]) app.whenReady().then(createWindow) + +app.on('before-quit', () => { + // @ts-ignore: import.meta.env does not exist in the types + if (import.meta.env.DEV) { + app.exit() + } +})