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

@ -42,31 +42,31 @@ export const AuctionCard = ({ project }: { project: Project }) => {
<LoadingIcon className="animate-spin" /> <LoadingIcon className="animate-spin" />
); );
const checkAuctionStatus = useCallback(async () => { const checkAuctionStatus = useCallback(async () => {
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);
}, []);
useEffect(() => { const fetchUpdatedProject = useCallback(async () => {
if (auctionStatus !== 'completed') { const updatedProject = await client.getProject(project.id);
checkAuctionStatus(); setDeployers(updatedProject.project!.deployers!);
const intervalId = setInterval(checkAuctionStatus, WAIT_DURATION); setFundsStatus(updatedProject.project!.fundsReleased!);
return () => clearInterval(intervalId); }, [project.id]);
}
if (auctionStatus === 'completed') { const fetchData = useCallback(async () => {
const fetchUpdatedProject = async () => { await Promise.all([checkAuctionStatus(), fetchUpdatedProject()]);
// Wait for 5 secs since the project is not immediately updated with deployer LRNs }, [checkAuctionStatus, fetchUpdatedProject]);
await new Promise((resolve) => setTimeout(resolve, WAIT_DURATION));
const updatedProject = await client.getProject(project.id); useEffect(() => {
setDeployers(updatedProject.project?.deployers || []); fetchData();
};
fetchUpdatedProject(); const timerId = setInterval(() => {
} fetchData();
}, [auctionStatus, client]); }, WAIT_DURATION);
return () => clearInterval(timerId);
}, [fetchData]);
const renderAuctionStatus = useCallback( const renderAuctionStatus = useCallback(
() => ( () => (