Skip to content

Commit

Permalink
fix(app): claimable rewards on v2 (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeifuChen authored Sep 21, 2023
1 parent f35bfcc commit c5e6b3a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/app/src/sections/dashboard/Stake/StakingTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import { Body, Heading } from 'components/Text'
import { STAKING_DISABLED } from 'constants/ui'
import { StakingCard } from 'sections/dashboard/Stake/card'
import { useAppDispatch, useAppSelector } from 'state/hooks'
import { claimStakingRewards } from 'state/staking/actions'
import { claimStakingRewards, claimStakingRewardsV2 } from 'state/staking/actions'
import {
selectApy,
selectClaimableBalance,
selectIsGettingReward,
selectStakedKwentaBalance,
selectStakingV1,
} from 'state/staking/selectors'
import media from 'styles/media'

Expand All @@ -29,11 +30,16 @@ const StakingTab = () => {
const claimableBalance = useAppSelector(selectClaimableBalance)
const stakedKwentaBalance = useAppSelector(selectStakedKwentaBalance)
const isClaimingReward = useAppSelector(selectIsGettingReward)
const stakingV1 = useAppSelector(selectStakingV1)
const apy = useAppSelector(selectApy)

const handleGetReward = useCallback(() => {
dispatch(claimStakingRewards())
}, [dispatch])
if (stakingV1) {
dispatch(claimStakingRewards())
} else {
dispatch(claimStakingRewardsV2())
}
}, [dispatch, stakingV1])

const stakingAndRewardsInfo: StakingCards[] = useMemo(
() => [
Expand Down

0 comments on commit c5e6b3a

Please sign in to comment.