Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function done(payload: *) {
updater.removeListener('update-available', onAvailable)
updater.removeListener('update-not-available', onNotAvailable)
updater.removeListener('error', onError)
dispatch({ type: 'shell:CHECK_UPDATE_RESULT', payload })
}
}
function done(payload: *) {
updater.removeListener('update-downloaded', onDownloaded)
updater.removeListener('error', onError)
dispatch({ type: 'shell:DOWNLOAD_UPDATE_RESULT', payload })
}
}
function done(payload: *) {
updater.removeListener('update-downloaded', onDownloaded)
updater.removeListener('error', onError)
dispatch({ type: 'shell:DOWNLOAD_UPDATE_RESULT', payload })
}
}
function done(payload: *) {
updater.removeListener('update-available', onAvailable)
updater.removeListener('update-not-available', onNotAvailable)
updater.removeListener('error', onError)
dispatch({ type: 'shell:CHECK_UPDATE_RESULT', payload })
}
}
module.exports = (notifyUpdateNotAvailable = false) => {
if(isDev) return Promise.resolve()
if(process.platform == "linux" && !process.env.APPIMAGE) return Promise.resolve()
const p = new Promise((resolve) => {
autoUpdater
.once('update-not-available', resolve)
.once('update-available', notifyUpdate(resolve))
})
autoUpdater
.removeListener('update-not-available', notifyNoUpdate)
if (notifyUpdateNotAvailable) autoUpdater
.once('update-not-available', notifyNoUpdate)
return autoUpdater.checkForUpdates().catch((e) => {
log.error('There was an error updating app. This is expected if using deb package.')
return Promise.resolve(p);
});
return p;
}
function done(payload: *) {
updater.removeListener('update-available', onAvailable)
updater.removeListener('update-not-available', onNotAvailable)
updater.removeListener('error', onError)
dispatch({ type: 'shell:CHECK_UPDATE_RESULT', payload })
}
}