DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
fix(updater): show breaking-change confirm on update click, not detection
hairyf1aac84242a5e
diff --git a/src/components/config-debug.tsx b/src/components/config-debug.tsxindex 451b7760..b778c4d5 100644--- a/src/components/config-debug.tsx+++ b/src/components/config-debug.tsx@@ -97,11 +97,17 @@ export function ConfigDebug() {}}- /** 「存在新版本」:先按 rc.2 破坏性更改确认(高于 rc.2 则先拦截),再展示更新提示 */- async function handleShowNewVersion() {- if (updateInfo && !(await confirmCoreBreaking(updateInfo.tag)))+ /** 「存在新版本」:直接展示更新提示;破坏性更改确认推迟到点击「立即更新」时 */+ function handleShowNewVersion() {+ store.harnessUpdater.showToast(() => handleUpdate())+ }++ /** 点击「立即更新」:目标版本高于 rc.2 时先弹破坏性更改确认,取消则中止更新 */+ async function handleUpdate() {+ const info = store.harnessUpdater.updateInfo+ if (!info || !(await confirmCoreBreaking(info.tag)))return- store.harnessUpdater.showToast()+ await store.harnessUpdater.handleUpdate()}const { mutate: onClearLogs } = useMutation({diff --git a/src/layout/components/harness-updater.tsx b/src/layout/components/harness-updater.tsxindex 54329af8..b6e90b3c 100644--- a/src/layout/components/harness-updater.tsx+++ b/src/layout/components/harness-updater.tsx@@ -11,14 +11,16 @@ export function HarnessUpdater() {useWatch([updateInfo, updating], () => {if (!updateInfo || updating)return- // 高于 rc.2 时先弹破坏性更改确认,取消则不提示更新(不进入下载)- void showAfterConfirm(updateInfo.tag)+ // 仅提示新版本,不打断用户;破坏性更改确认推迟到点击「立即更新」时(见 handleUpdate)+ store.harnessUpdater.showToast(() => handleUpdate())}, { immediate: true })- async function showAfterConfirm(tag: string) {- if (!(await confirmCoreBreaking(tag)))+ /** 点击「立即更新」:目标版本高于 rc.2 时先弹破坏性更改确认,取消则中止更新 */+ async function handleUpdate() {+ const info = store.harnessUpdater.updateInfo+ if (!info || !(await confirmCoreBreaking(info.tag)))return- store.harnessUpdater.showToast()+ await store.harnessUpdater.handleUpdate()}return holderdiff --git a/src/store/modules/harness-updater/store.ts b/src/store/modules/harness-updater/store.tsindex 4f35c9a1..99781ac2 100644--- a/src/store/modules/harness-updater/store.ts+++ b/src/store/modules/harness-updater/store.ts@@ -79,7 +79,12 @@ export const harnessUpdater = defineStore({this.updateInfo = null},- showToast() {+ /**+ * 展示「发现新版本」提示条。+ * onUpdate 由调用方(持有破坏性更改确认弹窗的组件)注入:点击「立即更新」时+ * 先确认(高于 rc.2 则弹框),确认后才真正安装;未注入时回退为直接更新。+ */+ showToast(onUpdate?: () => void) {if (!this.updateInfo)returntoast(t('update.available', { tag: this.updateInfo.tag }), {@@ -87,7 +92,10 @@ export const harnessUpdater = defineStore({children: t('update.now'),onPress: () => {toast.clear()- void this.handleUpdate()+ if (onUpdate)+ void onUpdate()+ else+ void this.handleUpdate()},variant: 'tertiary',},