From 07ed40812930cd3bb5642afcec22484f6770eaa7 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 29 Feb 2024 12:06:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E5=BC=B9=E7=AA=97=E5=9C=A8=E9=9D=9E=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=98=B6=E6=AE=B5=E6=84=8F=E5=A4=96=E5=BC=B9=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=88#1797=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/renderer/core/useApp/useUpdate.ts | 33 +++++++++++++++------------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 40b44e62..4e586541 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -9,6 +9,7 @@ - 修复某些情况下歌曲加载时间过长时不会自动跳到下一首的问题 - 修复mg歌词在某些情况下获取失败的问题(#1783) - 修复mg歌单搜索 +- 修复更新超时弹窗在非更新阶段意外弹出的问题(#1797) ### 其他 diff --git a/src/renderer/core/useApp/useUpdate.ts b/src/renderer/core/useApp/useUpdate.ts index cdecc910..0d2be3cd 100644 --- a/src/renderer/core/useApp/useUpdate.ts +++ b/src/renderer/core/useApp/useUpdate.ts @@ -20,19 +20,21 @@ export default () => { // 更新超时定时器 let updateTimeout: number | null = null - if (window.lx.isProd && !(isWin && process.arch.includes('arm'))) { - updateTimeout = window.setTimeout(() => { - updateTimeout = null - void nextTick(() => { - showUpdateModal() - setTimeout(() => { - void dialog({ - message: window.i18n.t('update__timeout_top'), - confirmButtonText: window.i18n.t('alert_button_text'), - }) - }, 500) - }) - }, 60 * 60 * 1000) + const startUpdateTimeout = () => { + if (window.lx.isProd && !(isWin && process.arch.includes('arm'))) { + updateTimeout = window.setTimeout(() => { + updateTimeout = null + void nextTick(() => { + showUpdateModal() + setTimeout(() => { + void dialog({ + message: window.i18n.t('update__timeout_top'), + confirmButtonText: window.i18n.t('alert_button_text'), + }) + }, 500) + }) + }, 60 * 60 * 1000) + } } const clearUpdateTimeout = () => { @@ -149,7 +151,10 @@ export default () => { desc: info.releaseNotes as string, } versionInfo.isLatest = false - if (appSetting['common.tryAutoUpdate']) versionInfo.status = 'downloading' + if (appSetting['common.tryAutoUpdate']) { + versionInfo.status = 'downloading' + startUpdateTimeout() + } void nextTick(() => { showUpdateModal() })