Skip to content
This repository was archived by the owner on Feb 5, 2021. It is now read-only.

Commit eb45ceb

Browse files
author
Howard Ju
committed
Quit and update the application after new version been downloaded
1 parent 4400571 commit eb45ceb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/controller/update-controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class UpdateController {
2121
detail: `${info.releaseNotes}`
2222
}, response => {
2323
if (response) {
24-
autoUpdater.downloadUpdate();
24+
autoUpdater.downloadUpdate().then(downloads => {
25+
autoUpdater.quitAndInstall();
26+
});
2527
}
2628
});
2729
});

src/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ class ElectronXiami {
5555
}
5656
});
5757

58+
app.on('before-quit', () => {
59+
this.tray.tray.destroy();
60+
});
61+
5862
app.on('quit', () => {
5963
// empty cover cache folder before exit.
6064
fs.remove(`${app.getPath('userData')}/covers`);

0 commit comments

Comments
 (0)