fix: show global when no rule groups

This commit is contained in:
GyDi 2022-11-21 23:06:32 +08:00
parent 781c67b31a
commit c9359978f9
No known key found for this signature in database
GPG Key ID: 9C3AD40F1F99880A

View File

@ -44,7 +44,9 @@ export const useRenderList = (mode: string) => {
// global 和 direct 使用展开的样式 // global 和 direct 使用展开的样式
const useRule = mode === "rule" || mode === "script"; const useRule = mode === "rule" || mode === "script";
const renderGroups = const renderGroups =
(useRule ? proxiesData?.groups : [proxiesData?.global!]) || []; (useRule && proxiesData.groups.length
? proxiesData.groups
: [proxiesData.global!]) || [];
const retList = renderGroups.flatMap((group) => { const retList = renderGroups.flatMap((group) => {
const headState = headStates[group.name] || DEFAULT_STATE; const headState = headStates[group.name] || DEFAULT_STATE;