From 1f3bdd89b98ca1dbe8845f0f33eef0bd6148e258 Mon Sep 17 00:00:00 2001 From: Nick Lionis Date: Fri, 11 Oct 2024 13:30:44 +0300 Subject: [PATCH] make sure the frame projects images are fetched --- .../Buttons/MintDonationImpactAction.tsx | 18 ++++++++++++------ .../src/features/round/ThankYou.tsx | 16 +++++++++++----- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/packages/grant-explorer/src/features/contributors/components/Buttons/MintDonationImpactAction.tsx b/packages/grant-explorer/src/features/contributors/components/Buttons/MintDonationImpactAction.tsx index b95d7498e..ee8f40f68 100644 --- a/packages/grant-explorer/src/features/contributors/components/Buttons/MintDonationImpactAction.tsx +++ b/packages/grant-explorer/src/features/contributors/components/Buttons/MintDonationImpactAction.tsx @@ -14,9 +14,7 @@ import { Contribution } from "data-layer"; import { ProgressStatus } from "../../../../hooks/attestations/config"; import { useEstimateGas } from "../../../../hooks/attestations/useEstimateGas"; -import { - AttestationChainId, -} from "../../../attestations/utils/constants"; +import { AttestationChainId } from "../../../attestations/utils/constants"; import { ethers } from "ethers"; import { useAttestationFee } from "../../hooks/useMintingAttestations"; @@ -57,7 +55,11 @@ export function MintDonationImpactAction({ [[transactionHash]] ); - const { data: imagesBase64, isLoading: isLoadingImages } = useGetImages( + const { + data: imagesBase64, + isLoading: isLoadingImages, + isFetched: imagesFetched, + } = useGetImages( FrameProps.projects.map((project) => project.image), isOpen ); @@ -65,7 +67,11 @@ export function MintDonationImpactAction({ const { data, isLoading, isRefetching } = useGetAttestationData( [transactionHash], handleGetAttestationPreview, - isLoadingENS || isLoadingImages || !isOpen || !startAction, + isLoadingENS || + isLoadingImages || + !isOpen || + !startAction || + !imagesFetched, selectedColor ); @@ -91,7 +97,7 @@ export function MintDonationImpactAction({ }); const { data: attestationFee } = useAttestationFee(); - console.log("====> A1", attestationFee) + console.log("====> A1", attestationFee); const notEnoughFunds = balance?.value && gasEstimation diff --git a/packages/grant-explorer/src/features/round/ThankYou.tsx b/packages/grant-explorer/src/features/round/ThankYou.tsx index 73173565d..75de7fe7b 100755 --- a/packages/grant-explorer/src/features/round/ThankYou.tsx +++ b/packages/grant-explorer/src/features/round/ThankYou.tsx @@ -26,9 +26,7 @@ import { useResolveENS } from "../../hooks/useENS"; import { useAccount, useBalance } from "wagmi"; import { useGetImages } from "../../hooks/attestations/useGetImages"; import { useEstimateGas } from "../../hooks/attestations/useEstimateGas"; -import { - AttestationChainId, -} from "../attestations/utils/constants"; +import { AttestationChainId } from "../attestations/utils/constants"; import { ethers } from "ethers"; import { useAttestationFee } from "../contributors/hooks/useMintingAttestations"; import { useAttestationStore } from "../../attestationStore"; @@ -141,7 +139,11 @@ export default function ThankYou() { const { data: name, isLoading: isLoadingENS } = useResolveENS(address); - const { data: imagesBase64, isLoading: isLoadingImages } = useGetImages( + const { + data: imagesBase64, + isLoading: isLoadingImages, + isFetched: imagesFetched, + } = useGetImages( ImpactFrameProps.projects.map((project) => project.image), isModalOpen ); @@ -149,7 +151,11 @@ export default function ThankYou() { const { data, isLoading } = useGetAttestationData( transactions, handleGetAttestationPreview, - isLoadingENS || isLoadingImages || !isModalOpen || isLoadingRoundNames, + isLoadingENS || + isLoadingImages || + !isModalOpen || + isLoadingRoundNames || + !imagesFetched, selectedBackground );