♻️ 函数式调用替代to-loading

This commit is contained in:
目棃
2024-11-15 17:52:06 +08:00
parent c87ec77543
commit 0c24b95fff
24 changed files with 297 additions and 701 deletions

View File

@@ -5,6 +5,7 @@
*/
import { exists, mkdir } from "@tauri-apps/plugin-fs";
import showLoading from "../components/func/loading.js";
import showSnackbar from "../components/func/snackbar.js";
import TSUserAbyss from "../plugins/Sqlite/modules/userAbyss.js";
import TSUserAccount from "../plugins/Sqlite/modules/userAccount.js";
@@ -44,26 +45,31 @@ export async function restoreUserData(dir: string): Promise<void> {
showSnackbar.error("备份目录不存在");
return;
}
showLoading.update("正在恢复数据...", "正在恢复成就数据");
const restoreAchi = await TSUserAchi.restoreUiaf(dir);
if (!restoreAchi) {
showSnackbar.error("成就数据恢复失败");
errNum++;
}
showLoading.update("正在恢复数据...", "正在恢复账号数据");
const restoreAccount = await TSUserAccount.account.restore(dir);
if (!restoreAccount) {
showSnackbar.error("Cookie 数据恢复失败");
errNum++;
}
showLoading.update("正在恢复数据...", "正在恢复深渊数据");
const restoreAbyss = await TSUserAbyss.restoreAbyss(dir);
if (!restoreAbyss) {
showSnackbar.error("深渊数据恢复失败");
errNum++;
}
showLoading.update("正在恢复数据...", "正在恢复真境剧诗数据");
const restoreCombat = await TSUserCombat.restoreCombat(dir);
if (!restoreCombat) {
showSnackbar.error("真境剧诗数据恢复失败");
errNum++;
}
showLoading.update("正在恢复数据...", "正在恢复祈愿数据");
const restoreGacha = await TSUserGacha.restoreUigf(dir);
if (!restoreGacha) {
showSnackbar.error("祈愿数据恢复失败");