@@ -212,6 +212,7 @@ export default function EnhancedTable({ claimable, crv, ibEUR, rKP3R }) {
212
212
const [ order , setOrder ] = React . useState ( 'desc' ) ;
213
213
const [ orderBy , setOrderBy ] = React . useState ( 'balance' ) ;
214
214
const [ claimLoading , setClaimLoading ] = React . useState ( false )
215
+ const [ claimedAsset , setClaimedAsset ] = React . useState ( )
215
216
216
217
React . useEffect ( ( ) => {
217
218
const rewardClaimed = ( ) => {
@@ -242,18 +243,18 @@ export default function EnhancedTable({ claimable, crv, ibEUR, rKP3R }) {
242
243
const onClaim = ( asset ) => {
243
244
console . log ( asset )
244
245
setClaimLoading ( true )
246
+ setClaimedAsset ( asset )
245
247
246
248
if ( asset . gauge ) {
247
249
// this is a gauge
248
250
stores . dispatcher . dispatch ( { type : FIXED_FOREX_CLAIM_CURVE_REWARDS , content : { asset : asset . gauge } } )
249
251
} else if ( asset . type === 'Fixed Forex' && asset . description === 'Fee Claim' ) {
250
252
stores . dispatcher . dispatch ( { type : FIXED_FOREX_CLAIM_DISTRIBUTION_REWARD , content : { } } )
251
- } else if ( gauge . type === 'Fixed Forex' && gauge . description === 'Vesting Rewards' ) {
253
+ } else if ( asset . type === 'Fixed Forex' && asset . description === 'Vesting Rewards' ) {
252
254
stores . dispatcher . dispatch ( { type : FIXED_FOREX_CLAIM_VESTING_REWARD , content : { } } )
253
- } else if ( gauge . type === 'Fixed Forex' && gauge . description === 'Redeemable KP3R' ) {
255
+ } else if ( asset . type === 'Fixed Forex' && asset . description === 'Redeemable KP3R' ) {
254
256
stores . dispatcher . dispatch ( { type : FIXED_FOREX_CLAIM_RKP3R , content : { } } )
255
257
}
256
-
257
258
}
258
259
259
260
if ( ! claimable ) {
@@ -349,10 +350,10 @@ export default function EnhancedTable({ claimable, crv, ibEUR, rKP3R }) {
349
350
variant = 'contained'
350
351
size = 'large'
351
352
color = 'primary'
352
- disabled = { claimLoading }
353
+ disabled = { claimLoading && ( ! claimedAsset || claimedAsset . symbol === row . symbol ) }
353
354
onClick = { ( ) => { onClaim ( row ) } } >
354
- < Typography className = { classes . actionButtonText } > { claimLoading ? `Claiming` : `Claim` } </ Typography >
355
- { claimLoading && < CircularProgress size = { 10 } className = { classes . loadingCircle } /> }
355
+ < Typography className = { classes . actionButtonText } > { claimLoading && ( ! claimedAsset || claimedAsset . symbol === row . symbol ) ? `Claiming` : `Claim` } </ Typography >
356
+ { claimLoading && ( ! claimedAsset || claimedAsset . symbol === row . symbol ) && < CircularProgress size = { 10 } className = { classes . loadingCircle } /> }
356
357
</ Button >
357
358
358
359
</ Grid >
0 commit comments