feat(update): 应用内更新提示支持英文 release notes

This commit is contained in:
t8y2
2026-07-07 00:26:56 +08:00
parent f45011977f
commit 9cbe857a2a
11 changed files with 214 additions and 20 deletions
@@ -6,6 +6,7 @@ import * as api from "@/lib/backend/api";
import { useSettingsStore } from "@/stores/settingsStore";
import type { UpdateDownloadSource as SettingsUpdateDownloadSource } from "@/stores/settingsStore";
import type { UpdateDownloadProgress } from "@/lib/backend/tauri";
import { currentLocale } from "@/i18n";
export function shouldOpenUpdateDialog(options: { silent?: boolean }) {
return options.silent !== true;
@@ -74,7 +75,7 @@ export function useAppUpdater() {
checkingUpdates.value = true;
updateCheckMessage.value = "";
try {
const info = await api.checkForUpdates();
const info = await api.checkForUpdates(currentLocale());
updateInfo.value = info;
if (info.update_available) {
if (shouldOpenUpdateDialog({ silent: options.silent })) {
+3 -2
View File
@@ -2042,8 +2042,9 @@ export async function deleteHistoryEntry(id: string): Promise<void> {
// Updates
// ---------------------------------------------------------------------------
export async function checkForUpdates(): Promise<UpdateInfo> {
return get("/api/update/check");
export async function checkForUpdates(locale?: string): Promise<UpdateInfo> {
const query = locale ? `?locale=${encodeURIComponent(locale)}` : "";
return get(`/api/update/check${query}`);
}
export async function checkMcpServerStatus(): Promise<import("@/lib/backend/tauri").McpServerStatus> {
+2 -2
View File
@@ -1270,8 +1270,8 @@ export async function installMcpServer(): Promise<string> {
return invoke("install_mcp_server");
}
export async function checkForUpdates(): Promise<UpdateInfo> {
return invoke("check_for_updates");
export async function checkForUpdates(locale?: string): Promise<UpdateInfo> {
return invoke("check_for_updates", { locale });
}
export async function getSystemProxyUrl(): Promise<string | null> {