Skip to content

Commit

Permalink
fix: delay update config
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi authored Sep 9, 2022
1 parent acfe5db commit ab53ab2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/setting/mods/core-switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useLockFn } from "ahooks";
import { Menu, MenuItem } from "@mui/material";
import { Settings } from "@mui/icons-material";
import { changeClashCore, getVergeConfig } from "@/services/cmds";
import { getVersion } from "@/services/api";
import Notice from "@/components/base/base-notice";

const VALID_CORE = [
Expand All @@ -28,8 +27,10 @@ const CoreSwitch = () => {
try {
await changeClashCore(core);
mutate("getVergeConfig");
mutate("getClashConfig");
mutate("getVersion", getVersion());
setTimeout(() => {
mutate("getClashConfig");
mutate("getVersion");
}, 100);
setAnchorEl(null);
Notice.success(`Successfully switch to ${core}`, 1000);
} catch (err: any) {
Expand Down

0 comments on commit ab53ab2

Please sign in to comment.