mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 02:12:10 +08:00
fix: serialize OS state reads with in-progress update_sysproxy
This commit is contained in:
@@ -57,10 +57,10 @@ export const useSystemProxyState = () => {
|
||||
while (pendingRef.current !== null) {
|
||||
const target = pendingRef.current
|
||||
pendingRef.current = null
|
||||
await patchVerge({ enable_system_proxy: target })
|
||||
if (!target && verge?.auto_close_connection) {
|
||||
await closeAllConnections().catch(() => {})
|
||||
}
|
||||
await patchVerge({ enable_system_proxy: target })
|
||||
}
|
||||
} finally {
|
||||
busyRef.current = false
|
||||
|
||||
Reference in New Issue
Block a user