Skip to content

Commit

Permalink
fix: crash my pool (#2049)
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv authored Jul 7, 2023
1 parent fb5dafa commit cbe2d53
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/ProAmmPool/PositionListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { APP_PATHS, PROMM_ANALYTICS_URL } from 'constants/index'
import { useActiveWeb3React } from 'hooks'
import { useToken } from 'hooks/Tokens'
import { useProMMFarmContract } from 'hooks/useContract'
// import { useProMMFarmContract } from 'hooks/useContract'
import useIsTickAtLimit from 'hooks/useIsTickAtLimit'
import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel'
import { usePool } from 'hooks/usePools'
Expand Down Expand Up @@ -194,7 +193,12 @@ function PositionListItem({

const [farmReward, setFarmReward] = useState<BigNumber[] | null>(null)

const res = useSingleCallResult(farmContract, 'getUserInfo', [tokenId, pid], NEVER_RELOAD)
const res = useSingleCallResult(
pid !== '' ? farmContract : undefined,
'getUserInfo',
pid !== '' ? [tokenId, pid] : undefined,
NEVER_RELOAD,
)
useEffect(() => {
if (res?.result?.rewardPending) {
setFarmReward(res.result.rewardPending)
Expand Down

0 comments on commit cbe2d53

Please sign in to comment.