Skip to content

Commit

Permalink
fix: distinct revoke item by permit2Id
Browse files Browse the repository at this point in the history
  • Loading branch information
richardo2016x committed Jul 26, 2024
1 parent 7d82b8f commit 728afd8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ui/views/ApprovalManagePage/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ export const findIndexRevokeList = <
if (
revoke.contractId === token.contract_id &&
revoke.spender === token.spender.id &&
(!revoke.permit2Id ||
revoke.permit2Id ===
findContractMatchedSpender(token, item)?.permit2_id) &&
revoke.tokenId === token.inner_id &&
revoke.chainServerId === token.chain
) {
Expand All @@ -129,6 +132,9 @@ export const findIndexRevokeList = <
if (
revoke.contractId === token.contract_id &&
revoke.spender === token.spender.id &&
(!revoke.permit2Id ||
revoke.permit2Id ===
findContractMatchedSpender(token, item)?.permit2_id) &&
revoke.chainServerId === token.chain
) {
return true;
Expand All @@ -138,6 +144,9 @@ export const findIndexRevokeList = <
return list.findIndex((revoke) => {
if (
revoke.spender === item.id &&
(!revoke.permit2Id ||
revoke.permit2Id ===
findContractMatchedSpender(token, item)?.permit2_id) &&
revoke.id === token.id &&
revoke.chainServerId === item.chain
) {
Expand All @@ -149,7 +158,6 @@ export const findIndexRevokeList = <
return list.findIndex((revoke) => {
if (
revoke.spender === (token as Spender).id &&
revoke.permit2Id === getFirstSpender(token)?.permit2_id &&
revoke.id === item.id &&
revoke.chainServerId === item.chain
) {
Expand Down

0 comments on commit 728afd8

Please sign in to comment.