fix(app-data-provider): dashboard state sync

This commit is contained in:
Slinetrac 2025-11-20 13:23:50 +08:00
parent c3fe2d31ef
commit 2bb9f648ba
No known key found for this signature in database

View File

@ -138,10 +138,15 @@ export const AppDataProvider = ({
if (now - lastUpdateTime <= refreshThrottle) return; if (now - lastUpdateTime <= refreshThrottle) return;
lastUpdateTime = now; lastUpdateTime = now;
scheduleTimeout(() => { scheduleTimeout(async () => {
refreshProxy().catch((error) => await Promise.all([
console.error("[DataProvider] Proxy refresh failed:", error), refreshProxy().catch((error) =>
); console.error("[DataProvider] Proxy refresh failed:", error),
),
refreshClashConfig().catch((error) =>
console.error("[DataProvider] Clash config refresh failed:", error),
),
]);
}, 200); }, 200);
}; };
@ -220,7 +225,7 @@ export const AppDataProvider = ({
); );
} }
}; };
}, [refreshProxy, refreshRules, refreshRuleProviders]); }, [refreshProxy, refreshClashConfig, refreshRules, refreshRuleProviders]);
const { data: sysproxy, mutate: refreshSysproxy } = useSWR( const { data: sysproxy, mutate: refreshSysproxy } = useSWR(
"getSystemProxy", "getSystemProxy",