fix: close connections when profile change
This commit is contained in:
parent
e00f826eb8
commit
e031389021
@ -12,7 +12,7 @@ import {
|
|||||||
importProfile,
|
importProfile,
|
||||||
enhanceProfiles,
|
enhanceProfiles,
|
||||||
} from "@/services/cmds";
|
} from "@/services/cmds";
|
||||||
import { getProxies, updateProxy } from "@/services/api";
|
import { closeAllConnections, getProxies, updateProxy } from "@/services/api";
|
||||||
import { atomCurrentProfile } from "@/services/states";
|
import { atomCurrentProfile } from "@/services/states";
|
||||||
import { BasePage, Notice } from "@/components/base";
|
import { BasePage, Notice } from "@/components/base";
|
||||||
import { ProfileNew } from "@/components/profile/profile-new";
|
import { ProfileNew } from "@/components/profile/profile-new";
|
||||||
@ -134,6 +134,7 @@ const ProfilePage = () => {
|
|||||||
setCurrentProfile(current);
|
setCurrentProfile(current);
|
||||||
mutate("getProfiles", { ...profiles, current: current }, true);
|
mutate("getProfiles", { ...profiles, current: current }, true);
|
||||||
mutate("getRuntimeLogs");
|
mutate("getRuntimeLogs");
|
||||||
|
closeAllConnections();
|
||||||
Notice.success("Refresh clash config", 1000);
|
Notice.success("Refresh clash config", 1000);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
Notice.error(err?.message || err.toString(), 4000);
|
Notice.error(err?.message || err.toString(), 4000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user