From dad956ab140c4464aa75b17405f23e50b6ca8f0a Mon Sep 17 00:00:00 2001 From: liamcottle Date: Tue, 9 Jul 2024 17:24:23 +1200 Subject: [PATCH] add button to quickly relaunch electron app after changing interfaces --- electron/main.js | 6 ++++++ electron/preload.js | 5 +++++ public/index.html | 17 ++++++++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/electron/main.js b/electron/main.js index 6e2a211..c86e438 100644 --- a/electron/main.js +++ b/electron/main.js @@ -35,6 +35,12 @@ ipcMain.handle('prompt', async(event, message) => { }); }); +// allow relaunching app via ipc +ipcMain.handle('relaunch', async() => { + app.relaunch(); + app.exit(); +}); + function log(message) { // make sure main window exists diff --git a/electron/preload.js b/electron/preload.js index 3fb66f2..74854cf 100644 --- a/electron/preload.js +++ b/electron/preload.js @@ -20,4 +20,9 @@ contextBridge.exposeInMainWorld('electron', { return await ipcRenderer.invoke('prompt', message); }, + // allow relaunching app in electron browser window + relaunch: async function() { + return await ipcRenderer.invoke('relaunch'); + }, + }); diff --git a/public/index.html b/public/index.html index b588a1b..b398fb4 100644 --- a/public/index.html +++ b/public/index.html @@ -883,13 +883,16 @@
-
-
+
+
-
Reticulum MeshChat must be restarted for any interface changes to take effect.
+
Reticulum MeshChat must be restarted for any interface changes to take effect.
+