fix: update tauri-plugin-mihomo version, improve error handling #6149

This commit is contained in:
Tunglies
2026-01-24 09:19:52 +08:00
parent 6e16133393
commit 334cec3bde
4 changed files with 29 additions and 25 deletions
+14 -2
View File
@@ -23,8 +23,8 @@ import {
} from "@mui/material";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import type { CSSProperties } from "react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { Outlet, useNavigate } from "react-router";
import { SWRConfig } from "swr";
@@ -257,12 +257,24 @@ const Layout = () => {
<SWRConfig
value={{
errorRetryCount: 3,
// TODO remove the 5000ms
errorRetryInterval: 5000,
onError: (error, key) => {
console.error(`[SWR Error] Key: ${key}, Error:`, error);
// FIXME the condition should not be handle gllobally
if (key !== "getAutotemProxy") {
console.error(`SWR Error for ${key}:`, error);
return;
}
// FIXME we need a better way to handle the retry when first booting app
const silentKeys = [
"getVersion",
"getClashConfig",
"getAutotemProxy",
];
if (silentKeys.includes(key)) return;
console.error(`[SWR Error] Key: ${key}, Error:`, error);
},
dedupingInterval: 2000,
}}
+5 -1
View File
@@ -32,7 +32,11 @@ export const AppDataProvider = ({
calcuProxies,
{
...SWR_REALTIME,
onError: (err) => console.warn("[DataProvider] Proxy fetch failed:", err),
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.
},
},
);