mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-25 15:12:29 +08:00
fix(proxies): stop auto delay test on entering chain mode
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
- 修复「链式代理」节点列表按名称排序,未保持订阅中的节点顺序
|
||||
- 修复规则模式下 Muse AI 解锁检测显示错误的出口地区
|
||||
- 修复使用系统代理或本地代理认证时首页 IP 信息显示直连地址或报错
|
||||
- 修复打开「链式代理」时自动对全部节点发起延迟测试
|
||||
|
||||
**🖥️ Windows**
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { useEffect, useMemo, useRef } from 'react'
|
||||
import { useMemo, useRef } from 'react'
|
||||
|
||||
import { useRuntimeConfig } from '@/hooks/use-clash'
|
||||
import { useGroupsDelays } from '@/hooks/use-group-delays'
|
||||
import { useVerge } from '@/hooks/use-verge'
|
||||
import { useAppRefreshers, useProxiesData } from '@/providers/app-data-context'
|
||||
import delayManager, { type DelaySnapshot } from '@/services/delay'
|
||||
import { type DelaySnapshot } from '@/services/delay'
|
||||
import {
|
||||
findCurrentGroupMember,
|
||||
isInteractableMember,
|
||||
resolveMember,
|
||||
selectGlobalChainNodes,
|
||||
selectRuleChainMembers,
|
||||
@@ -15,7 +14,6 @@ import {
|
||||
type ProxyViewV1,
|
||||
type ResolvedProxyMember,
|
||||
} from '@/types/proxy-view'
|
||||
import { debugLog } from '@/utils/debug'
|
||||
|
||||
import { filterSort, isDelayFilter } from './use-filter-sort'
|
||||
import {
|
||||
@@ -171,47 +169,6 @@ export const useRenderList = (
|
||||
selectedGroup,
|
||||
])
|
||||
|
||||
const chainOccurrencesRef = useRef(chainOccurrences)
|
||||
chainOccurrencesRef.current = chainOccurrences
|
||||
const chainDelayGroup =
|
||||
mode === 'rule' && selectedGroup ? selectedGroup : CHAIN_DELAY_GROUP
|
||||
const chainDelayKey = useMemo(
|
||||
() =>
|
||||
chainOccurrences
|
||||
.map(({ member }) => {
|
||||
if (member.kind !== 'node') return `${member.kind}:${member.ref.name}`
|
||||
const source = member.node.source
|
||||
return source.kind === 'provider'
|
||||
? `provider:${source.providerName}:${source.proxyName}`
|
||||
: `core:${source.proxyName}`
|
||||
})
|
||||
.join('\u0000'),
|
||||
[chainOccurrences],
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (!isChainMode || !chainDelayKey) return
|
||||
const interactable = chainOccurrencesRef.current
|
||||
.map(({ member }) => member)
|
||||
.filter(isInteractableMember)
|
||||
if (interactable.length === 0) return
|
||||
|
||||
const handle = setTimeout(() => {
|
||||
const timeout = verge?.default_latency_timeout || 10000
|
||||
debugLog(`[ChainMode] 开始计算 ${interactable.length} 个节点的延迟`)
|
||||
void delayManager.checkListDelay(interactable, chainDelayGroup, timeout)
|
||||
}, 100)
|
||||
|
||||
return () => {
|
||||
clearTimeout(handle)
|
||||
}
|
||||
}, [
|
||||
chainDelayGroup,
|
||||
chainDelayKey,
|
||||
isChainMode,
|
||||
verge?.default_latency_timeout,
|
||||
])
|
||||
|
||||
const renderGroups = useMemo(() => {
|
||||
if (!proxyView) return []
|
||||
// A profile whose only group is GLOBAL (mihomo then skips its built-in one)
|
||||
|
||||
Reference in New Issue
Block a user