Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(desktop-update): show current installed version in update dialog

hairyf787d31715b9f
diff --git a/src-tauri/src/service/update/mod.rs b/src-tauri/src/service/update/mod.rs
index 842d2d32..627d02f1 100644
--- a/src-tauri/src/service/update/mod.rs
+++ b/src-tauri/src/service/update/mod.rs
@@ -203,7 +203,10 @@ fn installer_path(app_handle: &AppHandle, asset_name: &str) -> Result<PathBuf, S
#[derive(Debug, Clone, serde::Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DesktopUpdateInfo {
+ /// 最新可用版本号(无 `v` 前缀)
pub version: String,
+ /// 当前已安装版本号(无 `v` 前缀)
+ pub current_version: String,
pub tag: String,
pub published_at: String,
pub url: String,
@@ -221,6 +224,7 @@ pub async fn check(app_handle: &AppHandle) -> Result<Option<DesktopUpdateInfo>,
let downloaded = path.exists();
Ok(Some(DesktopUpdateInfo {
version: r.version,
+ current_version: current_version(),
tag: r.tag,
published_at: r.published_at,
url: r.url,
diff --git a/src/components/desktop-update-dialog.tsx b/src/components/desktop-update-dialog.tsx
index 3f7b2940..095a3527 100644
--- a/src/components/desktop-update-dialog.tsx
+++ b/src/components/desktop-update-dialog.tsx
@@ -34,11 +34,11 @@ export default function DesktopUpdateDialog() {
<div className="space-y-1.5">
<div className="flex items-center justify-between text-sm">
<span className="text-muted">{t('ui.current_version')}</span>
- <span className="text-ink font-medium">{updateInfo?.version}</span>
+ <span className="text-ink font-medium">{updateInfo?.currentVersion}</span>
</div>
<div className="flex items-center justify-between text-sm">
<span className="text-muted">{t('update.new_version_label')}</span>
- <span className="text-ink font-medium">{updateInfo?.tag}</span>
+ <span className="text-ink font-medium">{updateInfo?.version}</span>
</div>
<If cond={updateInfo?.downloaded}>
<Description className="text-xs">
diff --git a/src/store/modules/desktop-update/types.ts b/src/store/modules/desktop-update/types.ts
index c54ef039..5f29bb8c 100644
--- a/src/store/modules/desktop-update/types.ts
+++ b/src/store/modules/desktop-update/types.ts
@@ -1,6 +1,9 @@
/** Rust 侧 check_desktop_update 返回的桌面端新版本信息 */
export interface DesktopUpdateInfo {
+ /** 最新可用版本号(无 v 前缀) */
version: string
+ /** 当前已安装版本号(无 v 前缀) */
+ currentVersion: string
tag: string
published_at: string
url: string