mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: close all connections when disable sysporxy
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
import { useLockFn } from "ahooks";
|
||||
import { Button, Tooltip } from "@mui/material";
|
||||
import { useSystemState } from "@/hooks/use-system-state";
|
||||
import { closeAllConnections } from "@/services/api";
|
||||
|
||||
interface Props {
|
||||
onError?: (err: Error) => void;
|
||||
@@ -182,6 +183,9 @@ const SettingSystem = ({ onError }: Props) => {
|
||||
onFormat={onSwitchFormat}
|
||||
onChange={(e) => onChangeData({ enable_system_proxy: e })}
|
||||
onGuard={async (e) => {
|
||||
if (!e && verge?.auto_close_connection) {
|
||||
closeAllConnections();
|
||||
}
|
||||
await patchVerge({ enable_system_proxy: e });
|
||||
await updateProxyStatus();
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user