fix: poll request status updates

This commit is contained in:
2026-04-22 14:06:41 -04:00
parent f108971559
commit 2a7b4f46b3
2 changed files with 10 additions and 0 deletions
@@ -30,6 +30,10 @@ export function RequestHistory() {
socket.off("request_updated", refresh);
};
}, [socket, status]);
useEffect(() => {
const id = setInterval(load, 15000);
return () => clearInterval(id);
}, [status]);
const filtered = requests.filter(
(r) =>
+6
View File
@@ -45,6 +45,12 @@ export default function DashboardPage() {
}
loadData();
}, [isAuthenticated, router]);
useEffect(() => {
const id = setInterval(() => {
if (isAuthenticated) loadData();
}, 15000);
return () => clearInterval(id);
}, [isAuthenticated]);
useEffect(() => {
if (!socket) return;
const refresh = () => loadData();