Skip to content

Commit

Permalink
fix: Native falsy bigint causing endless loading in usePermit2
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenshively committed May 22, 2024
1 parent ded1288 commit 52bb956
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/src/data/hooks/UsePermit2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export function usePermit2(chain: Chain, token: Token, owner: Address, spender:
// Search through `nonceBitmap` for valid nonces. If there aren't any, jump forward to the
// next bitmap by incrementing `nonceWordPos`
useEffect(() => {
if (!nonceBitmap) return;
if (nonceBitmap === undefined) return;

if (nonceBitmap === maxUint256) {
// NOTE: Selecting `nonceWordPos` randomly may help us find a valid nonce more quickly. However,
Expand Down Expand Up @@ -243,7 +243,7 @@ export function usePermit2(chain: Chain, token: Token, owner: Address, spender:

const amountStr = useMemo(() => amount.toString(GNFormat.INT), [amount]);
const permitTransferFrom: PermitTransferFrom | undefined = useMemo(() => {
if (!nonce) return undefined;
if (nonce == null) return undefined;
return {
permitted: {
token: token.address,
Expand Down

0 comments on commit 52bb956

Please sign in to comment.