From e5eace479d709d869920f357e322eb25bca5da37 Mon Sep 17 00:00:00 2001 From: Dr_rOot Date: Thu, 27 Apr 2023 16:51:06 +0800 Subject: [PATCH 1/2] fix: handle auto updater update canceled event --- src/main/Application.js | 7 +++++++ src/main/core/UpdateManager.js | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/main/Application.js b/src/main/Application.js index 8359e6c81..abf9c74c7 100644 --- a/src/main/Application.js +++ b/src/main/Application.js @@ -663,6 +663,13 @@ export default class Application extends EventEmitter { win.setProgressBar(0) }) + this.updateManager.on('update-cancelled', (event) => { + this.menuManager.updateMenuItemEnabledState('app.check-for-updates', true) + this.trayManager.updateMenuItemEnabledState('app.check-for-updates', true) + const win = this.windowManager.getWindow('index') + win.setProgressBar(-1) + }) + this.updateManager.on('will-updated', async (event) => { this.windowManager.setWillQuit(true) await this.stopAllSettled() diff --git a/src/main/core/UpdateManager.js b/src/main/core/UpdateManager.js index 75dd8ca76..7716f15b5 100644 --- a/src/main/core/UpdateManager.js +++ b/src/main/core/UpdateManager.js @@ -72,6 +72,8 @@ export default class UpdateManager extends EventEmitter { }).then(({ response }) => { if (response === 0) { this.updater.downloadUpdate() + } else { + this.emit('update-cancelled', info) } }) } From 71f4eeeb25a9b561576aa5a9fe23719b2367a067 Mon Sep 17 00:00:00 2001 From: Dr_rOot Date: Thu, 27 Apr 2023 16:51:28 +0800 Subject: [PATCH 2/2] chore: change app update generic url --- app-update.yml | 2 +- electron-builder.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app-update.yml b/app-update.yml index dfb062d34..c26d94cce 100644 --- a/app-update.yml +++ b/app-update.yml @@ -1,2 +1,2 @@ provider: generic -url: 'https://dl.motrix.app/release/' +url: 'https://dl.motrix.app/releases/' diff --git a/electron-builder.json b/electron-builder.json index fc2102a68..af967a92f 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -191,7 +191,7 @@ "publish": [ { "provider": "generic", - "url": "https://dl.motrix.app/release/" + "url": "https://dl.motrix.app/releases/" }, { "provider": "github"