Skip to content

Commit

Permalink
fix: Update auto-updater event listeners in main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Jun 12, 2024
1 parent 6234ddb commit c136813
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,12 @@ function checkForUpdates() {
resolve({ available: true, version: info.version, message: info.releaseNotes });
});

autoUpdater.once('update-not-available', () => {
macUpdater.once('update-not-available', () => {
console.log('No updates available.');
resolve({ available: false, message: 'No updates available.' });
});

autoUpdater.once('error', (error) => {
macUpdater.once('error', (error) => {
console.error('Error in auto-updater:', error);
reject(error);
});
Expand All @@ -561,14 +561,14 @@ function checkForUpdates() {

ipcMain.handle('check-for-updates', async () => {
console.log('Checking for updates...');
console.log(typeof macUpdater);
return { available: false, message: 'No updates available.' }
// try {
// const result = await checkForUpdates();
// return result;
// } catch (error) {
// throw new Error(error.message);
// }
// console.log(typeof macUpdater);
// return { checkForUpdates: macUpdater.checkForUpdates, available: false, message: 'No updates available.' }
try {
const result = await checkForUpdates();
return result;
} catch (error) {
throw new Error(error.message);
}
});

// PROCESS SPECIFIC EVENTS (HANDLES NON-GRACEFUL TERMINATION)
Expand Down

0 comments on commit c136813

Please sign in to comment.