Skip to content

Commit

Permalink
Move a cast up to higher location, but still expect that by the time …
Browse files Browse the repository at this point in the history
…the function is being called, proposalId must be a numberish
  • Loading branch information
adamgall committed May 23, 2024
1 parent 5fade89 commit 0f9cf90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hooks/DAO/proposal/useUserERC721VotingTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function useUserERC721VotingTokens(
const { erc721Tokens } = azoriusGovernance;

const getUserERC721VotingTokens = useCallback(
async (_safeAddress: string | null, _proposalId?: string) => {
async (_safeAddress: string | null, _proposalId?: number) => {
const totalTokenAddresses: string[] = [];
const totalTokenIds: string[] = [];
const tokenAddresses: string[] = [];
Expand Down Expand Up @@ -187,7 +187,7 @@ export default function useUserERC721VotingTokens(
totalTokenIds.push(tokenId);
if (_proposalId) {
const tokenVoted = await votingContract.read.hasVoted([
Number(_proposalId),
_proposalId,
getAddress(tokenAddress),
BigInt(tokenId),
]);
Expand Down Expand Up @@ -222,7 +222,7 @@ export default function useUserERC721VotingTokens(
);

const loadUserERC721VotingTokens = useCallback(async () => {
const tokensInfo = await getUserERC721VotingTokens(safeAddress, proposalId);
const tokensInfo = await getUserERC721VotingTokens(safeAddress, Number(proposalId));
if (tokensInfo) {
setTotalVotingTokenAddresses(tokensInfo.totalVotingTokenAddresses);
setTotalVotingTokenIds(tokensInfo.totalVotingTokenIds);
Expand Down

0 comments on commit 0f9cf90

Please sign in to comment.