mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-06 20:02:49 +08:00
fix: 热更新后版本 banner 不再重复显示「需要重载」
- main.js: 热更新下载成功时保存已应用版本到 localStorage - checkGlobalUpdate 检查 hotApplied 标记,跳过已应用的版本
This commit is contained in:
@@ -642,6 +642,10 @@ async function checkGlobalUpdate() {
|
||||
const dismissed = localStorage.getItem('clawpanel_update_dismissed')
|
||||
if (dismissed === ver) return
|
||||
|
||||
// 热更新已下载并重载过,不再重复提示同一版本
|
||||
const hotApplied = localStorage.getItem('clawpanel_hot_update_applied')
|
||||
if (hotApplied === ver) return
|
||||
|
||||
const changelog = info.manifest?.changelog || ''
|
||||
const isWeb = !window.__TAURI_INTERNALS__
|
||||
|
||||
@@ -707,6 +711,7 @@ sudo systemctl restart clawpanel</pre>
|
||||
btn.textContent = '下载中...'
|
||||
try {
|
||||
await api.downloadFrontendUpdate(info.manifest?.url || '', info.manifest?.hash || '')
|
||||
localStorage.setItem('clawpanel_hot_update_applied', ver)
|
||||
btn.textContent = '重载应用'
|
||||
btn.disabled = false
|
||||
btn.onclick = () => window.location.reload()
|
||||
|
||||
Reference in New Issue
Block a user