Display project URLs in Overview tab #20

Merged
nabarun merged 5 commits from nv-display-base-domain into main 2024-10-29 14:10:02 +00:00
Showing only changes of commit 97354f35a1 - Show all commits

View File

@ -46,27 +46,27 @@ export const AuctionCard = ({ project }: { project: Project }) => {
const result = await client.getAuctionData(project.auctionId); const result = await client.getAuctionData(project.auctionId);
setAuctionStatus(result.status); setAuctionStatus(result.status);
setAuctionDetails(result); setAuctionDetails(result);
setDeployers(project.deployers); }, [project.auctionId, project.deployers, project.fundsReleased]);
setFundsStatus(project.fundsReleased);
}, []); const fetchUpdatedProject = useCallback(async () => {
const updatedProject = await client.getProject(project.id);
setDeployers(updatedProject.project!.deployers!);
setFundsStatus(updatedProject.project!.fundsReleased!);
}, [project.id]);
const fetchData = useCallback(async () => {
await Promise.all([checkAuctionStatus(), fetchUpdatedProject()]);
}, [checkAuctionStatus, fetchUpdatedProject]);
useEffect(() => { useEffect(() => {
if (auctionStatus !== 'completed') { fetchData();
checkAuctionStatus();
const intervalId = setInterval(checkAuctionStatus, WAIT_DURATION);
return () => clearInterval(intervalId);
}
if (auctionStatus === 'completed') { const timerId = setInterval(() => {
const fetchUpdatedProject = async () => { fetchData();
// Wait for 5 secs since the project is not immediately updated with deployer LRNs }, WAIT_DURATION);
await new Promise((resolve) => setTimeout(resolve, WAIT_DURATION));
const updatedProject = await client.getProject(project.id); return () => clearInterval(timerId);
setDeployers(updatedProject.project?.deployers || []); }, [fetchData]);
};
fetchUpdatedProject();
}
}, [auctionStatus, client]);
const renderAuctionStatus = useCallback( const renderAuctionStatus = useCallback(
() => ( () => (