fix: 修复开发模式下,首页请求两次的问题

master
Lxy 3 months ago
parent 02606aeaad
commit c8329f0d07

@ -21,13 +21,20 @@ const Dashboard = () => {
const [pushForm] = Form.useForm();
const [messageApi, contextHolder] = message.useMessage();
// refAPI
const fetchingRef = React.useRef(false);
useEffect(() => {
if (!fetchingRef.current) {
fetchingRef.current = true;
dispatch(fetchFuturesOverview());
dispatch(fetchRiskAlerts());
dispatch(fetchAIMarketAnalysis());
}
}, [dispatch]);
const handleRefresh = () => {
fetchingRef.current = false;
dispatch(fetchFuturesOverview());
dispatch(fetchRiskAlerts());
dispatch(fetchAIMarketAnalysis());

Loading…
Cancel
Save