Skip to content

Commit

Permalink
make sure the frame projects images are fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
nijoe1 committed Oct 11, 2024
1 parent 7bee55f commit 1f3bdd8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -57,15 +55,23 @@ 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
);

const { data, isLoading, isRefetching } = useGetAttestationData(
[transactionHash],
handleGetAttestationPreview,
isLoadingENS || isLoadingImages || !isOpen || !startAction,
isLoadingENS ||
isLoadingImages ||
!isOpen ||
!startAction ||
!imagesFetched,
selectedColor
);

Expand All @@ -91,7 +97,7 @@ export function MintDonationImpactAction({
});

const { data: attestationFee } = useAttestationFee();
console.log("====> A1", attestationFee)
console.log("====> A1", attestationFee);

const notEnoughFunds =
balance?.value && gasEstimation
Expand Down
16 changes: 11 additions & 5 deletions packages/grant-explorer/src/features/round/ThankYou.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -141,15 +139,23 @@ 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
);

const { data, isLoading } = useGetAttestationData(
transactions,
handleGetAttestationPreview,
isLoadingENS || isLoadingImages || !isModalOpen || isLoadingRoundNames,
isLoadingENS ||
isLoadingImages ||
!isModalOpen ||
isLoadingRoundNames ||
!imagesFetched,
selectedBackground
);

Expand Down

0 comments on commit 1f3bdd8

Please sign in to comment.