web-app/src/components/common/OutboundCallWidget.jsx
@@ -341,9 +341,17 @@ // 设置轮询定时器(10秒间隔) const interval = setInterval(fetchCallStatus, POLL_INTERVAL); // 监听外呼任务更新事件(立即刷新) const handleOutboundJobsUpdated = () => { console.log('收到外呼任务更新事件,立即刷新'); fetchCallStatus(); }; window.addEventListener('outbound-jobs-updated', handleOutboundJobsUpdated); // 清理函数 return () => { clearInterval(interval); window.removeEventListener('outbound-jobs-updated', handleOutboundJobsUpdated); isMountedRef.current = false; }; }, [fetchCallStatus]);