From 702d3ff2d79b075e939ae2d6ac457220e1f006ed Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Sat, 28 Oct 2023 10:20:59 +0100 Subject: [PATCH] fixed unsaved records prompt --- main.js | 4 ++++ preload.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index a4ba1329..b6762c0e 100644 --- a/main.js +++ b/main.js @@ -448,6 +448,10 @@ ipcMain.handle('request-worker-channel', async (_event) =>{ // without going through the main process! }) +ipcMain.handle('unsaved-records', (_event, data) => { + unsavedRecords = data.newValue; // Update the variable with the new value + console.log('Unsaved records:', unsavedRecords); +}); ipcMain.handle('openFiles', async (config) => { // Show file dialog to select audio file diff --git a/preload.js b/preload.js index ba67d602..44c0a90f 100644 --- a/preload.js +++ b/preload.js @@ -43,7 +43,7 @@ ipcRenderer.once('provide-worker-channel', async (event) => { contextBridge.exposeInMainWorld('electron', { requestWorkerChannel: () => ipcRenderer.invoke('request-worker-channel'), - unsavedRecords: (isTrue) => ipcRenderer.send('unsaved-records', { newValue: isTrue }), + unsavedRecords: (isTrue) => ipcRenderer.invoke('unsaved-records', { newValue: isTrue }), onDownloadProgress: (callback) => ipcRenderer.on('download-progress', callback), saveFile: (args) => ipcRenderer.invoke('saveFile', args), selectDirectory: () => ipcRenderer.invoke('selectDirectory'),