fix: delay update config
This commit is contained in:
parent
acfe5dbb49
commit
ab53ab21e2
@ -4,7 +4,6 @@ import { useLockFn } from "ahooks";
|
|||||||
import { Menu, MenuItem } from "@mui/material";
|
import { Menu, MenuItem } from "@mui/material";
|
||||||
import { Settings } from "@mui/icons-material";
|
import { Settings } from "@mui/icons-material";
|
||||||
import { changeClashCore, getVergeConfig } from "@/services/cmds";
|
import { changeClashCore, getVergeConfig } from "@/services/cmds";
|
||||||
import { getVersion } from "@/services/api";
|
|
||||||
import Notice from "@/components/base/base-notice";
|
import Notice from "@/components/base/base-notice";
|
||||||
|
|
||||||
const VALID_CORE = [
|
const VALID_CORE = [
|
||||||
@ -28,8 +27,10 @@ const CoreSwitch = () => {
|
|||||||
try {
|
try {
|
||||||
await changeClashCore(core);
|
await changeClashCore(core);
|
||||||
mutate("getVergeConfig");
|
mutate("getVergeConfig");
|
||||||
|
setTimeout(() => {
|
||||||
mutate("getClashConfig");
|
mutate("getClashConfig");
|
||||||
mutate("getVersion", getVersion());
|
mutate("getVersion");
|
||||||
|
}, 100);
|
||||||
setAnchorEl(null);
|
setAnchorEl(null);
|
||||||
Notice.success(`Successfully switch to ${core}`, 1000);
|
Notice.success(`Successfully switch to ${core}`, 1000);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user