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

View File

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