Skip to content

Commit

Permalink
nextjs lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed Jan 18, 2024
1 parent ebade82 commit 17c55ed
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/nextjs/components/example-ui/tokens/TokenInteractions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ export const useERC1155Information = (address?: string) => {
const addressArr = [];
const tokenIdsArr: bigint[] = [];

for (let i = 0; i < numOfTokens!; i++) {
addressArr.push(address!);
tokenIdsArr.push(BigInt(i));
const iterator = numOfTokens ?? 0;
for (let i = 0; i < iterator; i++) {
if (address) {
addressArr.push(address);
tokenIdsArr.push(BigInt(i));
}
}

const { data: balanceOfBatch } = useScaffoldContractRead({
Expand Down Expand Up @@ -86,7 +89,7 @@ export const useERC1155Information = (address?: string) => {
if (uris.length === 0) {
getUris();
}
}, [address, repTokensInstance, tokenIdsArr]); // Empty dependency array to run the effect only once
}, [address, repTokensInstance, tokenIdsArr, uris.length]); // Empty dependency array to run the effect only once

console.log(uris);

Expand All @@ -107,7 +110,7 @@ export const useERC1155Information = (address?: string) => {
}

if (responses.length === 0) getJson();
}, [uris]);
}, [uris.length, responses.length]);

console.log(responses);

Expand All @@ -116,9 +119,13 @@ export const useERC1155Information = (address?: string) => {

const tokens: Token[] = [];
for (let i = 0; i < responses.length; i++) {
let balance = BigInt(0);
if (balanceOfBatch) {
balance = balanceOfBatch[i];
}
const obj = {
id: i,
balance: balanceOfBatch![i],
balance: balance,
name: responses[i]?.name,
description: responses[i]?.description,
image: responses[i]?.image,
Expand Down

0 comments on commit 17c55ed

Please sign in to comment.