Skip to content

Commit

Permalink
fix: read update version number
Browse files Browse the repository at this point in the history
  • Loading branch information
ert78gb committed Apr 15, 2024
1 parent d4262cd commit 2521b83
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ autoUpdater.on('checking-for-update', () => {
win.webContents.send('auto-update-status', { message: 'Checking for update', type: 'info' })
})

autoUpdater.on('update-available', (event, info) => {
logger.log('update-available', info)
autoUpdater.on('update-available', (event) => {
logger.log('update-available', event)

const version = info && info.version || 'unknown'
const version =event?.version || 'unknown'

win.webContents.send('auto-update-status', {
event: 'update-available',
Expand All @@ -97,8 +97,8 @@ autoUpdater.on('download-progress', (progress) => {
win.webContents.send('auto-update-status', { message: `Downloading update ${progress.percent}`, type: 'info' })
})

autoUpdater.on('update-downloaded', (event, info) => {
const version = info && info.version || 'unknows'
autoUpdater.on('update-downloaded', (event) => {
const version = event.version || 'unknown'
win.webContents.send('auto-update-status', {
event: 'update-downloaded',
message: `${version} version downloaded`,
Expand Down

0 comments on commit 2521b83

Please sign in to comment.