File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -155,13 +155,14 @@ export const useClaimConfig = (
155155 }
156156 } , [ stakerReward ?. isClaimed , isClaimed ] ) ;
157157
158+ const userReward = voterRewards ?. items . find (
159+ ( voterReward ) => voterReward ?. userAddress === userAddress ,
160+ ) ;
161+
158162 const userVoteRewardAmount = useMemo ( ( ) => {
159163 if ( ! userAddress || ! voterRewards ?. items ) {
160164 return 0 ;
161165 }
162- const userReward = voterRewards . items . find (
163- ( voterReward ) => voterReward ?. userAddress === userAddress ,
164- ) ;
165166
166167 if ( ! userReward ) {
167168 return 0 ;
@@ -199,7 +200,9 @@ export const useClaimConfig = (
199200 // Else, return full widget
200201 const buttonTextId = isClaimed ? 'button.claimed' : 'button.claim' ;
201202 const remainingStakesNumber = remainingStakes . length ;
202- const canClaimStakes = userTotalStake ? ! userTotalStake . isZero ( ) : false ;
203+ const canClaimStakes = userTotalStake
204+ ? ! userTotalStake . isZero ( )
205+ : ! ! userReward ;
203206 const handleClaimSuccess = ( ) => {
204207 setIsClaimed ( true ) ;
205208 startPollingAction ( getSafePollingInterval ( ) ) ;
You can’t perform that action at this time.
0 commit comments