refactor: remove SWR_REALTIME configuration and simplify SWR usage in AppDataProvider

This commit is contained in:
Tunglies
2026-01-27 20:07:48 +08:00
parent 9d81a13c58
commit 36926df26c
2 changed files with 4 additions and 15 deletions
+2 -9
View File
@@ -15,7 +15,7 @@ import {
getRunningMode,
getSystemProxy,
} from "@/services/cmds";
import { SWR_DEFAULTS, SWR_MIHOMO, SWR_REALTIME } from "@/services/config";
import { SWR_DEFAULTS, SWR_MIHOMO } from "@/services/config";
import { AppDataContext, AppDataContextType } from "./app-data-context";
@@ -30,14 +30,7 @@ export const AppDataProvider = ({
const { data: proxiesData, mutate: refreshProxy } = useSWR(
"getProxies",
calcuProxies,
{
...SWR_REALTIME,
onError: (_) => {
// FIXME when we intially start the app, and core is starting,
// there will be error thrown by getProxies API.
// We should handle this case properly later.
},
},
SWR_MIHOMO,
);
const { data: clashConfig, mutate: refreshClashConfig } = useSWR(