uberf-8210: allow only one upgrade (#6684)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2024-09-23 12:36:57 +04:00 committed by GitHub
parent bbe2e4e9ce
commit 678da06af4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -365,7 +365,12 @@ if (isMac) {
})
}
// Note: it is reset when the app is relaunched after update
let isUpdating = false
autoUpdater.on('update-available', (info: UpdateInfo) => {
if (isUpdating) return
void dialog
.showMessageBox({
type: 'info',
@ -379,6 +384,7 @@ autoUpdater.on('update-available', (info: UpdateInfo) => {
if (response !== 0) {
app.quit()
}
isUpdating = true
})
})
@ -400,7 +406,7 @@ autoUpdater.on('update-downloaded', (info) => {
ipcMain.on('start-backup', (event, token, endpoint, workspace) => {
console.log('start backup', token, endpoint, workspace)
if (mainWindow != null) {
startBackup(mainWindow, token, endpoint, workspace , (cmd: string, ...args: any[]) => {
startBackup(mainWindow, token, endpoint, workspace, (cmd: string, ...args: any[]) => {
mainWindow?.webContents.send(cmd, ...args)
})
}