Skip to content

Commit

Permalink
refactor: simplify conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito committed Nov 3, 2023
1 parent 7a99abc commit 15ad18f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export function usePreGeneratedPermitInfoForToken(token: Nullish<Currency>): {
} {
const { allPermitInfo, isLoading } = usePreGeneratedPermitInfo()

const permitInfo =
allPermitInfo && token && 'address' in token ? allPermitInfo[token.address.toLowerCase()] : undefined
const address = token && 'address' in token && token.address.toLowerCase()

const permitInfo = address ? allPermitInfo[address] : undefined

return {
permitInfo,
Expand Down

0 comments on commit 15ad18f

Please sign in to comment.