Skip to content
Snippets Groups Projects
Unverified Commit b7c38638 authored by GyDi's avatar GyDi
Browse files

fix: patch clash config

parent d759f48e
No related branches found
No related tags found
No related merge requests found
......@@ -169,7 +169,9 @@ pub async fn patch_clash(patch: Mapping) -> Result<()> {
|| patch.get("secret").is_some()
|| patch.get("external-controller").is_some()
{
Config::generate()?;
CoreManager::global().run_core().await?;
handle::Handle::refresh_clash();
}
// 更新系统代理
......
......@@ -61,10 +61,14 @@ const ClashPortViewer = ({ handler }: Props) => {
setOpen(false);
if (port === config?.["mixed-port"]) return;
await patchClashConfig({ "mixed-port": port });
setGlobalClashPort(port);
Notice.success("Change Clash port successfully!", 1000);
mutateClash();
try {
await patchClashConfig({ "mixed-port": port });
setGlobalClashPort(port);
Notice.success("Change Clash port successfully!", 1000);
mutateClash();
} catch (err: any) {
Notice.error(err.message || err.toString(), 5000);
}
});
return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment