🐛 Preload project member counts

This commit is contained in:
eust-w 2026-08-29 09:13:56 +08:00
parent b884d63400
commit 792fc5e72e

View File

@ -314,6 +314,20 @@ export default function ProjectDetail() {
});
}, [id, reloadToken]);
useEffect(() => {
if (!id) return;
let cancelled = false;
projectsApi
.listMembers(id)
.then((items) => {
if (!cancelled) setProjectMemberCount(items.length);
})
.catch((error) => console.warn("Failed to load project member count", error));
return () => {
cancelled = true;
};
}, [id]);
// Poll workflow statuses so a run that finishes while the page is open is reflected
// (e.g. a "running" card flips to "completed"). Mirrors Monitoring's 15s poll; silent
// refresh — no loading/error flash, just keeps the workflow list current.