dev.....!

This commit is contained in:
Gabe Yuan
2023-08-31 13:38:06 +08:00
parent aa795e2731
commit 4486ad353c
15 changed files with 50 additions and 41 deletions

View File

@@ -37,10 +37,6 @@ export default function Settings() {
});
};
if (!setting) {
return;
}
const {
uiLang,
googleUrl,

View File

@@ -7,7 +7,7 @@ import Alert from "@mui/material/Alert";
import Link from "@mui/material/Link";
import { URL_KISS_WORKER } from "../../config";
import { useState } from "react";
import { syncAll } from "../../libs/sync";
import { syncSettingAndRules } from "../../libs/sync";
import Button from "@mui/material/Button";
import { useAlert } from "../../hooks/Alert";
import SyncIcon from "@mui/icons-material/Sync";
@@ -31,7 +31,7 @@ export default function SyncSetting() {
e.preventDefault();
try {
setLoading(true);
await syncAll();
await syncSettingAndRules();
alert.success(i18n("data_sync_success"));
} catch (err) {
console.log("[sync all]", err);

View File

@@ -10,7 +10,7 @@ import { useEffect, useState } from "react";
import { isGm } from "../../libs/client";
import { sleep } from "../../libs/utils";
import CircularProgress from "@mui/material/CircularProgress";
import { trySyncAll } from "../../libs/sync";
import { trySyncSettingAndRules } from "../../libs/sync";
import { AlertProvider } from "../../hooks/Alert";
import Link from "@mui/material/Link";
import Divider from "@mui/material/Divider";
@@ -27,6 +27,8 @@ export default function Options() {
let i = 0;
for (;;) {
if (window.APP_NAME === process.env.REACT_APP_NAME) {
// 同步数据
await trySyncSettingAndRules();
setReady(true);
break;
}
@@ -38,10 +40,11 @@ export default function Options() {
await sleep(1000);
}
} else {
// 同步数据
await trySyncSettingAndRules();
setReady(true);
}
// 同步数据
trySyncAll();
})();
}, []);
@@ -75,7 +78,7 @@ export default function Options() {
);
}
if (isGm && !ready) {
if (!ready) {
return (
<center>
<Divider>