@@ -52,8 +52,8 @@ export const GeyserStakeView = () => {
52
52
refreshStats,
53
53
vaultStats : { currentStakeable } ,
54
54
} = useContext ( StatsContext )
55
- const { connectWallet, address } = useContext ( Web3Context )
56
- const currentStakeAmount = BigNumber . from ( currentLock ? currentLock . amount : '0' )
55
+ const { connectWallet, ready } = useContext ( Web3Context )
56
+ const currentStakeAmount = BigNumber . from ( ready && currentLock ? currentLock . amount : '0' )
57
57
const [ unstakeConfirmModalOpen , setUnstakeConfirmModalOpen ] = useState < boolean > ( false )
58
58
const [ actualRewardsFromUnstake , setActualRewardsFromUnstake ] = useState < BigNumber > ( BigNumber . from ( '0' ) )
59
59
const [ actualStakingTokensFromUnstake , setActualStakingTokensFromUnstake ] = useState < BigNumber > ( BigNumber . from ( '0' ) )
@@ -80,7 +80,7 @@ export const GeyserStakeView = () => {
80
80
useEffect ( ( ) => {
81
81
refreshInputAmount ( )
82
82
if ( geyserAction === GeyserAction . STAKE ) {
83
- if ( ! address ) {
83
+ if ( ! ready ) {
84
84
setDefaultInputAmount ( )
85
85
} else if ( currentStakeAmount . eq ( 0 ) && stakableAmount . eq ( 0 ) ) {
86
86
setDefaultInputAmount ( )
@@ -89,7 +89,7 @@ export const GeyserStakeView = () => {
89
89
setParsedUserInput ( stakableAmount )
90
90
}
91
91
}
92
- } , [ address , geyserAction , stakingTokenBalance , currentStakeable ] )
92
+ } , [ ready , geyserAction , stakingTokenBalance , currentStakeable ] )
93
93
94
94
const handleGeyserInteraction = ( ) => {
95
95
if ( geyserAction === GeyserAction . STAKE ) {
@@ -193,12 +193,12 @@ export const GeyserStakeView = () => {
193
193
/>
194
194
{ isWrapped ? < WrapperWarning /> : null }
195
195
< EstimatedRewards parsedUserInput = { parsedUserInput } />
196
- { ! address && < ConnectWalletWarning onClick = { ( ) => connectWallet ( ) } /> }
197
- { address && parsedUserInput . gt ( 0 ) && (
196
+ { ! ready && < ConnectWalletWarning onClick = { ( ) => connectWallet ( ) } /> }
197
+ { ready && parsedUserInput . gt ( 0 ) && (
198
198
< StakeWarning link = { poolAddress } balance = { stakableAmount . sub ( parsedUserInput ) } staked = { currentStakeAmount } />
199
199
) }
200
200
< GeyserInteractionButton
201
- disabled = { ! address || parsedUserInput . isZero ( ) || parsedUserInput . gt ( stakableAmount ) }
201
+ disabled = { ! ready || parsedUserInput . isZero ( ) || parsedUserInput . gt ( stakableAmount ) }
202
202
onClick = { handleGeyserInteraction }
203
203
displayText = "Stake"
204
204
/>
@@ -237,9 +237,9 @@ export const GeyserStakeView = () => {
237
237
maxValue = { currentStakeAmount }
238
238
/>
239
239
< UnstakeSummary userInput = { userInput } parsedUserInput = { parsedUserInput } />
240
- { ! address && < ConnectWalletWarning onClick = { ( ) => connectWallet ( ) } /> }
240
+ { ! ready && < ConnectWalletWarning onClick = { ( ) => connectWallet ( ) } /> }
241
241
< GeyserInteractionButton
242
- disabled = { ! address || parsedUserInput . isZero ( ) }
242
+ disabled = { ! ready || parsedUserInput . isZero ( ) }
243
243
onClick = { handleGeyserInteraction }
244
244
displayText = "Unstake"
245
245
/>
@@ -310,7 +310,7 @@ export const GeyserStakeView = () => {
310
310
{ isWrap && selectedVault ? < WrapperCheckbox checked = { depositToVault } onChange = { setDepositToVault } /> : null }
311
311
312
312
< GeyserInteractionButton
313
- disabled = { ! address || parsedUserInput . isZero ( ) }
313
+ disabled = { ! ready || parsedUserInput . isZero ( ) }
314
314
onClick = { handleGeyserInteraction }
315
315
displayText = { isWrap ? 'Wrap' : 'Unwrap' }
316
316
/>
0 commit comments