修复更新超时弹窗在非更新阶段意外弹出的问题(#1797)

pull/1072/merge
lyswhut 2024-02-29 12:06:06 +08:00
parent c001803d71
commit 07ed408129
2 changed files with 20 additions and 14 deletions

View File

@ -9,6 +9,7 @@
- 修复某些情况下歌曲加载时间过长时不会自动跳到下一首的问题 - 修复某些情况下歌曲加载时间过长时不会自动跳到下一首的问题
- 修复mg歌词在某些情况下获取失败的问题#1783 - 修复mg歌词在某些情况下获取失败的问题#1783
- 修复mg歌单搜索 - 修复mg歌单搜索
- 修复更新超时弹窗在非更新阶段意外弹出的问题(#1797
### 其他 ### 其他

View File

@ -20,6 +20,7 @@ export default () => {
// 更新超时定时器 // 更新超时定时器
let updateTimeout: number | null = null let updateTimeout: number | null = null
const startUpdateTimeout = () => {
if (window.lx.isProd && !(isWin && process.arch.includes('arm'))) { if (window.lx.isProd && !(isWin && process.arch.includes('arm'))) {
updateTimeout = window.setTimeout(() => { updateTimeout = window.setTimeout(() => {
updateTimeout = null updateTimeout = null
@ -34,6 +35,7 @@ export default () => {
}) })
}, 60 * 60 * 1000) }, 60 * 60 * 1000)
} }
}
const clearUpdateTimeout = () => { const clearUpdateTimeout = () => {
if (!updateTimeout) return if (!updateTimeout) return
@ -149,7 +151,10 @@ export default () => {
desc: info.releaseNotes as string, desc: info.releaseNotes as string,
} }
versionInfo.isLatest = false versionInfo.isLatest = false
if (appSetting['common.tryAutoUpdate']) versionInfo.status = 'downloading' if (appSetting['common.tryAutoUpdate']) {
versionInfo.status = 'downloading'
startUpdateTimeout()
}
void nextTick(() => { void nextTick(() => {
showUpdateModal() showUpdateModal()
}) })