diff --git a/frontend/components/panels/StakePanel.tsx b/frontend/components/panels/StakePanel.tsx index 641c4e91..f8eb861c 100644 --- a/frontend/components/panels/StakePanel.tsx +++ b/frontend/components/panels/StakePanel.tsx @@ -40,23 +40,19 @@ export function StakePanel({ mainStakeAccount }: StakePanelProps) { const [amount, setAmount] = useState('') - const deposit = useCallback( - (amount: string) => - // we are disabling actions when mainStakeAccount is undefined - // or stakeConnection is undefined - depositMutation.mutate({ - amount, - // If mainStakeAccount is undefined this action is disabled - // undefined means that the mainStakeAccount is loading. - // If we execute this action, this will work. But it will create a - // new stake account for the user. - mainStakeAccount: mainStakeAccount as StakeAccount | 'NA', - // action is disabled below if these is undefined - stakeConnection: stakeConnection!, - }), - [] - ) - + const deposit = (amount: string) => + // we are disabling actions when mainStakeAccount is undefined + // or stakeConnection is undefined + depositMutation.mutate({ + amount, + // If mainStakeAccount is undefined this action is disabled + // undefined means that the mainStakeAccount is loading. + // If we execute this action, this will work. But it will create a + // new stake account for the user. + mainStakeAccount: mainStakeAccount as StakeAccount | 'NA', + // action is disabled below if these is undefined + stakeConnection: stakeConnection!, + }) const isSufficientBalance = isSufficientBalanceFn(amount, pythBalance) // set amount when input changes