feat: event emit when clash config update

This commit is contained in:
GyDi
2022-03-13 01:37:41 +08:00
parent 39703120a4
commit 003fcf446a
5 changed files with 31 additions and 34 deletions

View File

@@ -30,12 +30,10 @@ const Layout = () => {
if (e.key === "Escape") appWindow.hide();
});
listen("restart_clash", async () => {
listen("verge://refresh-clash-config", async () => {
// the clash info may be updated
await getAxios(true);
// make sure that the clash is ok
setTimeout(() => mutate("getProxies"), 1000);
setTimeout(() => mutate("getProxies"), 2000);
mutate("getProxies");
mutate("getClashConfig");
});
}, []);