feat(check): 更新完后自动更新资源

This commit is contained in:
BTMuli
2023-04-23 15:44:49 +08:00
parent 8f728808a8
commit bbfd608b02
2 changed files with 13 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ import { fs, window, app, event } from "@tauri-apps/api";
import { useAppStore } from "./store/modules/app";
// utils
import { InitTGData, DeleteTGData, WriteTGData } from "./utils/TGIndex";
import { getBuildTime } from "./utils/TGBuild";
// data
import { TGAppDataList, TGGetDataList } from "./data";
@@ -68,6 +69,13 @@ async function listenOnTheme () {
}
async function checkLoad () {
const localBuildTime = appStore.buildTime;
const buildTime = getBuildTime();
if (localBuildTime !== buildTime) {
appStore.buildTime = buildTime;
console.info("数据已过期,开始加载数据...");
appStore.loading = false;
}
if (appStore.loading) {
console.info("数据已加载!");
return;