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" 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) } }) }