mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-30 10:42:09 +08:00
refactor: replace useSWR with custom hooks for update and network interfaces (#6195)
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { useEffect, useMemo } from "react";
|
||||
import useSWR from "swr";
|
||||
|
||||
import { useRuntimeConfig } from "@/hooks/use-clash";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { useAppData } from "@/providers/app-data-context";
|
||||
import { getRuntimeConfig } from "@/services/cmds";
|
||||
import delayManager from "@/services/delay";
|
||||
import { debugLog } from "@/utils/debug";
|
||||
|
||||
@@ -107,14 +106,7 @@ export const useRenderList = (
|
||||
const latencyTimeout = verge?.default_latency_timeout;
|
||||
|
||||
// 获取运行时配置用于链式代理模式
|
||||
const { data: runtimeConfig } = useSWR(
|
||||
isChainMode ? "getRuntimeConfig" : null,
|
||||
getRuntimeConfig,
|
||||
{
|
||||
revalidateOnFocus: false,
|
||||
revalidateIfStale: true,
|
||||
},
|
||||
);
|
||||
const { data: runtimeConfig } = useRuntimeConfig(!!isChainMode);
|
||||
|
||||
// 计算列数
|
||||
const col = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user