mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
🎨 一些调整
This commit is contained in:
@@ -283,25 +283,11 @@ async function getGachaLogs(pool: string, endId: string = "0", check?: string):
|
||||
|
||||
// 导入按钮点击事件
|
||||
async function handleImportBtn(isV4: boolean): Promise<void> {
|
||||
if (isV4) {
|
||||
const checkConfirm = await showConfirm({ title: "确定导入UIGFv4格式的祈愿数据?" });
|
||||
if (!checkConfirm) {
|
||||
showSnackbar({ color: "cancel", text: "已取消 UIGF v4 格式导入" });
|
||||
return;
|
||||
}
|
||||
await TGLogger.Info("[UserGacha][handleImportBtn] 导入祈愿数据(v4)");
|
||||
} else {
|
||||
await TGLogger.Info("[UserGacha][handleImportBtn] 导入祈愿数据");
|
||||
}
|
||||
await TGLogger.Info(`[UserGacha][handleImportBtn] 导入祈愿数据${isV4 ? "(v4)" : ""}`);
|
||||
const selectedFile = await open({
|
||||
multiple: false,
|
||||
title: "选择要导入的祈愿数据文件",
|
||||
filters: [
|
||||
{
|
||||
name: "UIGF JSON",
|
||||
extensions: ["json"],
|
||||
},
|
||||
],
|
||||
title: "导入UIGF文件",
|
||||
filters: [{ name: "UIGF JSON", extensions: ["json"] }],
|
||||
defaultPath: await path.downloadDir(),
|
||||
directory: false,
|
||||
});
|
||||
@@ -311,11 +297,8 @@ async function handleImportBtn(isV4: boolean): Promise<void> {
|
||||
}
|
||||
const check = await verifyUigfData(selectedFile, isV4);
|
||||
if (!check) return;
|
||||
if (isV4) {
|
||||
await importUigf4(selectedFile);
|
||||
} else {
|
||||
await importUigf(selectedFile);
|
||||
}
|
||||
if (isV4) await importUigf4(selectedFile);
|
||||
else await importUigf(selectedFile);
|
||||
}
|
||||
|
||||
// 导入 v4 版本的祈愿数据
|
||||
@@ -393,13 +376,8 @@ async function exportUigf(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
const file = await save({
|
||||
title: "选择导出祈愿数据的文件路径",
|
||||
filters: [
|
||||
{
|
||||
name: "UIGF JSON",
|
||||
extensions: ["json"],
|
||||
},
|
||||
],
|
||||
title: "导出祈愿数据",
|
||||
filters: [{ name: "UIGF JSON", extensions: ["json"] }],
|
||||
defaultPath: `${await path.downloadDir()}${path.sep()}UIGF_${uidCur.value}.json`,
|
||||
});
|
||||
if (!file) {
|
||||
|
||||
Reference in New Issue
Block a user