From ceaf3639513ba4af6363dfe5a24c9cdffd30d9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=B4=E5=A4=A9?= Date: Thu, 26 Mar 2026 03:12:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=83=AD=E6=9B=B4=E6=96=B0=E5=90=8E?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20banner=20=E4=B8=8D=E5=86=8D=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=98=BE=E7=A4=BA=E3=80=8C=E9=9C=80=E8=A6=81=E9=87=8D?= =?UTF-8?q?=E8=BD=BD=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main.js: 热更新下载成功时保存已应用版本到 localStorage - checkGlobalUpdate 检查 hotApplied 标记,跳过已应用的版本 --- src/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.js b/src/main.js index 3a70fed..248b8fc 100644 --- a/src/main.js +++ b/src/main.js @@ -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 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()