fix(proxy): merge static and provider entries in snapshot; fix Virtuoso viewport height

This commit is contained in:
Slinetrac
2025-10-24 21:48:54 +08:00
Unverified
parent ead312090d
commit 89d7c7c3e5
2 changed files with 11 additions and 10 deletions

View File

@@ -381,6 +381,11 @@ export const ProxyGroups = (props: Props) => {
return Array.from(new Set(names));
}, [renderList]);
const virtuosoHeight =
mode === "rule" && proxyGroupNames.length > 0
? "calc(100% - 80px)"
: "calc(100% - 14px)";
if (mode === "direct") {
return <BaseEmpty text={t("clash_mode_direct")} />;
}
@@ -464,10 +469,7 @@ export const ProxyGroups = (props: Props) => {
<Virtuoso
ref={virtuosoRef}
style={{
height:
mode === "rule" && proxyGroupNames.length > 0
? "calc(100% - 80px)"
: "calc(100% - 14px)",
height: virtuosoHeight,
}}
totalCount={renderList.length}
increaseViewportBy={{ top: 200, bottom: 200 }}
@@ -607,7 +609,7 @@ export const ProxyGroups = (props: Props) => {
<Virtuoso
ref={virtuosoRef}
style={{ height: "calc(100% - 14px)" }}
style={{ height: virtuosoHeight }}
totalCount={renderList.length}
increaseViewportBy={{ top: 200, bottom: 200 }}
overscan={150}

View File

@@ -66,11 +66,10 @@ const parseProxyGroup = (
const name = entry.name;
if (!name) return null;
const rawList: unknown[] = Array.isArray(entry.proxies)
? entry.proxies
: Array.isArray(entry.use)
? entry.use
: [];
const rawList: unknown[] = [
...(Array.isArray(entry.proxies) ? entry.proxies : []),
...(Array.isArray(entry.use) ? entry.use : []),
];
const uniqueNames = Array.from(
new Set(