Skip to content

A full-featured download manager.

refactor: update manager last check update time

Dr_rOot3ec4bd26e6e5
diff --git a/src/main/Application.js b/src/main/Application.js
index d1ad3e94..b10a2312 100644
--- a/src/main/Application.js
+++ b/src/main/Application.js
@@ -248,9 +248,9 @@ export default class Application extends EventEmitter {
if (is.mas()) {
return
}
+
this.updateManager = new UpdateManager({
- autoCheck: this.isNeedAutoCheck(),
- setCheckTime: this.configManager
+ autoCheck: this.isNeedAutoCheck()
})
this.handleUpdaterEvents()
}
@@ -269,6 +269,7 @@ export default class Application extends EventEmitter {
this.updateManager.on('checking', (event) => {
this.menuManager.updateMenuItemEnabledState('app.check-for-updates', false)
this.trayManager.updateMenuItemEnabledState('app.check-for-updates', false)
+ this.configManager.setUserConfig('last-check-update-time', Date.now())
})
this.updateManager.on('download-progress', (event) => {
diff --git a/src/main/core/UpdateManager.js b/src/main/core/UpdateManager.js
index 46c4141d..6a890f32 100644
--- a/src/main/core/UpdateManager.js
+++ b/src/main/core/UpdateManager.js
@@ -43,13 +43,11 @@ export default class UpdateManager extends EventEmitter {
if (this.autoCheckData.checkEnable) {
this.autoCheckData.userCheck = false
- this.options.setCheckTime.setUserConfig('last-check-update-time', Date.now())
this.updater.checkForUpdates()
}
}
check () {
- this.options.setCheckTime.setUserConfig('last-check-update-time', Date.now())
this.autoCheckData.userCheck = true
this.updater.checkForUpdates()
}