Skip to content

Commit

Permalink
fixed unsaved records prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Oct 28, 2023
1 parent 486e1dc commit 702d3ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 702d3ff

Please sign in to comment.