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:
TonyWu
2026-11-17 10:37:27 +00:00
committed by GitHub
parent 3e3084cd34
commit fa3007d3a4
2 changed files with 11 additions and 9 deletions
+1
View File
@@ -37,6 +37,7 @@
- 修复断开链式代理时清空已选节点,导致再次连接需要重新选择
- 修复「连接」页表格排序时表头换行、标题位置跳动
- 修复「TUN 设置」未手动保存时,界面显示的默认 MTU 1500 未生效
- 修复「链式代理」节点列表按名称排序,未保持订阅中的节点顺序
**🍎 macOS**
+10 -9
View File
@@ -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] : []
},
)
}