Skip to content
Snippets Groups Projects
Unverified Commit cc5b33a8 authored by GyDi's avatar GyDi
Browse files

fix: refresh proxies interval, close #235

parent 6e1a627b
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,9 @@ import ProxyGroup from "@/components/proxy/proxy-group"; ...@@ -13,7 +13,9 @@ import ProxyGroup from "@/components/proxy/proxy-group";
const ProxyPage = () => { const ProxyPage = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const { mutate } = useSWRConfig(); 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 { data: clashConfig } = useSWR("getClashConfig", getClashConfig);
const modeList = ["rule", "global", "direct", "script"]; const modeList = ["rule", "global", "direct", "script"];
...@@ -37,6 +39,7 @@ const ProxyPage = () => { ...@@ -37,6 +39,7 @@ const ProxyPage = () => {
mutate("getClashConfig"); mutate("getClashConfig");
}); });
// 仅mode为全局和直连的时候展示global分组
const displayGroups = useMemo(() => { const displayGroups = useMemo(() => {
if (!global) return groups; if (!global) return groups;
if (curMode === "global" || curMode === "direct") if (curMode === "global" || curMode === "direct")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment