add button to quickly relaunch electron app after changing interfaces

This commit is contained in:
liamcottle 2024-07-09 17:24:23 +12:00
commit dad956ab14
3 changed files with 25 additions and 3 deletions

View file

@ -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

View file

@ -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');
},
});