mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 19:22:44 +08:00
* fix: check if service installed when toggle tun mode on tray * chore: cargo fmt * fix: auto disable tun mode * docs: update UPDATELOG.md * fix: init Tun mode status * chore: update * feat: disable tun mode tray menu when tun mode is unavailable * fix: restart core when uninstall service is canceled * chore: remove check notification when toggle tun mode * chore: fix updatelog --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
25 lines
488 B
TypeScript
25 lines
488 B
TypeScript
import useSWR from "swr";
|
|
|
|
import { getVergeConfig, patchVergeConfig } from "@/services/cmds";
|
|
|
|
export const useVerge = () => {
|
|
const { data: verge, mutate: mutateVerge } = useSWR(
|
|
"getVergeConfig",
|
|
async () => {
|
|
const config = await getVergeConfig();
|
|
return config;
|
|
},
|
|
);
|
|
|
|
const patchVerge = async (value: Partial<IVergeConfig>) => {
|
|
await patchVergeConfig(value);
|
|
mutateVerge();
|
|
};
|
|
|
|
return {
|
|
verge,
|
|
mutateVerge,
|
|
patchVerge,
|
|
};
|
|
};
|