mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-21 11:42:09 +08:00
fix(proxy): keep subscription order in chain proxy mode (#8391)
Since #7542 the global chain list follows the proxy view's standalone records, which are name-sorted, and the runtime config's proxies array is only used as a membership filter. Walk that array in order instead so the list matches the subscription order again. Fixes #8381
This commit is contained in:
+10
-9
@@ -120,19 +120,20 @@ const selectRuntimeStandaloneNodes = (
|
||||
view: ProxyViewV1,
|
||||
runtimeProxies: unknown,
|
||||
) => {
|
||||
const runtimeProxyNames = new Set(
|
||||
(Array.isArray(runtimeProxies) ? runtimeProxies : []).flatMap((proxy) => {
|
||||
const coreNodes = new Map(
|
||||
resolveStandaloneNodes(view).flatMap((node) =>
|
||||
node.source.kind === 'core' ? [[node.source.proxyName, node]] : [],
|
||||
),
|
||||
)
|
||||
return (Array.isArray(runtimeProxies) ? runtimeProxies : []).flatMap(
|
||||
(proxy) => {
|
||||
const name =
|
||||
typeof proxy === 'object' && proxy !== null && 'name' in proxy
|
||||
? proxy.name
|
||||
: undefined
|
||||
return typeof name === 'string' && name.length > 0 ? [name] : []
|
||||
}),
|
||||
)
|
||||
return resolveStandaloneNodes(view).filter(
|
||||
(node) =>
|
||||
node.source.kind === 'core' &&
|
||||
runtimeProxyNames.has(node.source.proxyName),
|
||||
const node = typeof name === 'string' ? coreNodes.get(name) : undefined
|
||||
return node ? [node] : []
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user