Skip to content

Commit

Permalink
fix: close connections when profile change
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi committed Nov 22, 2022
1 parent e00f826 commit e031389
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/profiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
importProfile,
enhanceProfiles,
} from "@/services/cmds";
import { getProxies, updateProxy } from "@/services/api";
import { closeAllConnections, getProxies, updateProxy } from "@/services/api";
import { atomCurrentProfile } from "@/services/states";
import { BasePage, Notice } from "@/components/base";
import { ProfileNew } from "@/components/profile/profile-new";
Expand Down Expand Up @@ -134,6 +134,7 @@ const ProfilePage = () => {
setCurrentProfile(current);
mutate("getProfiles", { ...profiles, current: current }, true);
mutate("getRuntimeLogs");
closeAllConnections();
Notice.success("Refresh clash config", 1000);
} catch (err: any) {
Notice.error(err?.message || err.toString(), 4000);
Expand Down

0 comments on commit e031389

Please sign in to comment.