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'),