mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-04-25 22:29:42 +08:00
♻️ 函数式调用替代to-loading
This commit is contained in:
@@ -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("祈愿数据恢复失败");
|
||||
|
||||
Reference in New Issue
Block a user