Explorar o código

fix: show global when no rule groups

GyDi %!s(int64=2) %!d(string=hai) anos
pai
achega
c9359978f9
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/components/proxy/use-render-list.ts

+ 3 - 1
src/components/proxy/use-render-list.ts

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