feat: show app and content version separately

This commit is contained in:
Timi
2026-11-07 15:15:36 +08:00
parent c204cad375
commit deb93e1af0
3 changed files with 9 additions and 3 deletions
+5 -1
View File
@@ -15,6 +15,7 @@ export const AUTO_UPDATE_KEY = "app.autoUpdate";
export function useAppUpdate() {
const supported = Capacitor.isNativePlatform();
const currentVersion = ref("");
const nativeVersion = ref("");
const latest = ref<LatestVersion | null>(null);
const checking = ref(false);
const downloading = ref(false);
@@ -22,7 +23,7 @@ export function useAppUpdate() {
const ready = ref<BundleInfo | null>(null);
const error = ref("");
/** 读取当前运行的 Web 包版本,内置包为 builtin */
/** 读取当前运行的 Web 包版本与原生壳版本 */
async function loadCurrent(): Promise<void> {
if (!supported) {
return;
@@ -30,8 +31,10 @@ export function useAppUpdate() {
try {
const result = await CapacitorUpdater.current();
currentVersion.value = result.bundle?.version ?? "builtin";
nativeVersion.value = result.native ?? "";
} catch {
currentVersion.value = "";
nativeVersion.value = "";
}
}
@@ -111,6 +114,7 @@ export function useAppUpdate() {
return {
supported,
currentVersion,
nativeVersion,
latest,
checking,
downloading,