feat(update): 应用内更新提示支持英文 release notes
This commit is contained in:
@@ -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 })) {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user