From cc5b33a8ec6e05e697b4c7a5f69ec21c96d8db9c Mon Sep 17 00:00:00 2001
From: GyDi <segydi@foxmail.com>
Date: Wed, 26 Oct 2022 01:08:34 +0800
Subject: [PATCH] fix: refresh proxies interval, close #235

---
 src/pages/proxies.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/pages/proxies.tsx b/src/pages/proxies.tsx
index 4693b2a..dde730b 100644
--- a/src/pages/proxies.tsx
+++ b/src/pages/proxies.tsx
@@ -13,7 +13,9 @@ import ProxyGroup from "@/components/proxy/proxy-group";
 const ProxyPage = () => {
   const { t } = useTranslation();
   const { mutate } = useSWRConfig();
-  const { data: proxiesData } = useSWR("getProxies", getProxies);
+  const { data: proxiesData } = useSWR("getProxies", getProxies, {
+    refreshInterval: 45000, // 45s
+  });
   const { data: clashConfig } = useSWR("getClashConfig", getClashConfig);
 
   const modeList = ["rule", "global", "direct", "script"];
@@ -37,6 +39,7 @@ const ProxyPage = () => {
     mutate("getClashConfig");
   });
 
+  // 仅mode为全局和直连的时候展示global分组
   const displayGroups = useMemo(() => {
     if (!global) return groups;
     if (curMode === "global" || curMode === "direct")
-- 
GitLab