diff --git a/src/pages/MyListed.tsx b/src/pages/MyListed.tsx index f7151efa..dfd8fa12 100644 --- a/src/pages/MyListed.tsx +++ b/src/pages/MyListed.tsx @@ -37,8 +37,8 @@ export const MyListed = () => { async function fetchDataNfts() { setIsNftLoading(true); - - const _dataNfts: DataNft[] = await DataNft.createManyFromApi(offers.map((offer) => offer.offeredTokenNonce)); + const nonces: number[] = offers.map((offer) => offer.offeredTokenNonce); + const _dataNfts: DataNft[] = await DataNft.createManyFromApi(nonces); console.log("_dataNfts", _dataNfts); setDataNfts(_dataNfts); @@ -52,6 +52,8 @@ export const MyListed = () => { }, [address, hasPendingTransactions]); useEffect(() => { + if (!offers.length) return; + fetchDataNfts(); }, [offers]); @@ -68,37 +70,36 @@ export const MyListed = () => {