mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-30 02:32:09 +08:00
feat: auto close connection when proxy changed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import useSWR from "swr";
|
||||
import { getVergeConfig, patchVergeConfig } from "@/services/cmds";
|
||||
|
||||
export const useVergeConfig = () => {
|
||||
const { data, mutate } = useSWR("getVergeConfig", getVergeConfig);
|
||||
|
||||
const patchVerge = async (value: Partial<CmdType.VergeConfig>) => {
|
||||
await patchVergeConfig(value);
|
||||
mutate();
|
||||
};
|
||||
|
||||
return {
|
||||
data,
|
||||
patchVerge,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user