Skip to content

Commit

Permalink
fix(erc721 approval): isApprovedForAll returns bool
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Nov 29, 2021
1 parent 5567da4 commit e10eb3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/blockchain-wallet-v4/src/redux/payment/nfts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1332,17 +1332,17 @@ async function approveSemiOrNonFungibleToken({
// Use this long way of calling so we can check for method existence on a bool-returning method.
const isApprovedForAll = await tokenContract.isApprovedForAll(accountAddress, proxyAddress)
console.log(isApprovedForAll)
return parseInt(isApprovedForAll)
return isApprovedForAll
}
const isApprovedForAll = await approvalAllCheck()

if (isApprovedForAll === 1) {
if (isApprovedForAll) {
// Supports ApproveAll
console.log('Already approved proxy for all tokens')
return null
}

if (isApprovedForAll === 0) {
if (!isApprovedForAll) {
// Supports ApproveAll
// not approved for all yet

Expand Down

0 comments on commit e10eb3a

Please sign in to comment.