feat: 优化应用更新检查逻辑;在生产环境中延迟检查更新并重构状态管理

This commit is contained in:
2025-12-30 19:34:34 +07:00
parent b6132ea30d
commit 72e7c77003
3 changed files with 40 additions and 40 deletions

View File

@@ -5,7 +5,7 @@ import { checkbox, close, contrastOutline, information, languageOutline, refresh
const { t } = useI18n();
const router = useIonRouter();
const { cacheSize, calculateCacheSize, clearCache } = useCacheSize();
const { isChecking, checkAndPromptUpdate } = useAppUpdate();
const { isChecking, getCurrentVersion, checkAndPromptUpdate } = useAppUpdate();
const { currentLanguage } = useLanguage();
const { theme } = useTheme();
const themeNames = {
@@ -13,6 +13,7 @@ const themeNames = {
dark: t("settings.themeDark"),
auto: t("settings.themeAuto"),
};
const currentVersion = await getCurrentVersion();
function handleClearCache() {
clearCache();
@@ -115,6 +116,9 @@ onMounted(() => {
{{ t("settings.checkUpdate") }}
</div>
</div>
<div class="end">
{{ currentVersion }}
</div>
</div>
</ion-item>
</ion-list>