略微整理更新超时机制

This commit is contained in:
lyswhut
2019-09-04 11:28:54 +08:00
parent 0aeab00289
commit 0586639e07
3 changed files with 8 additions and 5 deletions
+3
View File
@@ -98,6 +98,7 @@ export default {
})
})
rendererOn('update-error', () => {
if (!this.updateTimeout) return
this.setVersionModalVisible({ isError: true })
this.clearUpdateTimeout()
this.$nextTick(() => {
@@ -109,12 +110,14 @@ export default {
this.showUpdateModal()
})
rendererOn('update-not-available', () => {
if (!this.updateTimeout) return
if (this.setting.ignoreVersion) this.setSetting(Object.assign({}, this.setting, { ignoreVersion: null }))
this.clearUpdateTimeout()
this.setNewVersion({
version: this.version.version,
})
})
// 更新超时定时器
this.updateTimeout = setTimeout(() => {
this.updateTimeout = null
this.setVersionModalVisible({ isError: true })