Merge pull request #1342 from nymtech/bugfix/prevent-multiple-send-requests

Bugfix: Prevent multiple send requests
This commit is contained in:
Tommy Verrall
2022-06-10 11:21:11 +01:00
committed by GitHub
+5 -3
View File
@@ -62,6 +62,8 @@ export const SendWizard = () => {
};
const handleSend = async () => {
setIsLoading(true);
const formState = methods.getValues();
const hasEnoughFunds = await checkHasEnoughFunds(formState.amount.amount);
@@ -72,7 +74,6 @@ export const SendWizard = () => {
handlePreviousStep();
return;
}
setIsLoading(true);
setActiveStep((s) => s + 1);
send({
@@ -89,13 +90,14 @@ export const SendWizard = () => {
...details,
tx_hash,
});
setIsLoading(false);
userBalance.fetchBalance();
})
.catch((e) => {
setRequestError(e);
setIsLoading(false);
Console.error(e);
})
.finally(() => {
setIsLoading(false);
});
};