Skip to content

Commit

Permalink
fix(proxies): disconnect after proxy is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyruso authored and Zephyruso committed Sep 8, 2023
1 parent e4021bb commit a8cb75f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/signals/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export const useProxies = () => {
const proxyGroupList = proxies().slice()
const proxyGroup = proxyGroupList.find((i) => i.name === proxy.name)!

await request.put(`proxies/${proxy.name}`, {
body: JSON.stringify({
name: proxyName,
}),
})

if (autoCloseConns()) {
activeConnections().forEach(({ id, chains }) => {
if (chains.includes(proxy.name)) {
Expand All @@ -90,14 +96,7 @@ export const useProxies = () => {
})
}

await request.put(`proxies/${proxy.name}`, {
body: JSON.stringify({
name: proxyName,
}),
})

proxyGroup.now = proxyName

setProxies(proxyGroupList)
}

Expand Down

0 comments on commit a8cb75f

Please sign in to comment.