Skip to content

Commit

Permalink
fix: registration retry
Browse files Browse the repository at this point in the history
  • Loading branch information
tomicvladan committed Oct 11, 2023
1 parent c42f156 commit e0f0ae6
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/pages/register/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import { sendFunds } from "../../utils/account.utils";
import axios from "axios";
import { RegistrationRequest } from "@fairdatasociety/fdp-storage/dist/account/types";
import { useLocales } from "../../context/locales.context";
import { MULTIPLY_ETH_RESULT_FACTOR, roundWeiToEther } from '../../utils/eth.utils'
import {
MULTIPLY_ETH_RESULT_FACTOR,
roundWeiToEther,
} from "../../utils/eth.utils";

enum Steps {
UsernamePassword,
Expand Down Expand Up @@ -231,8 +234,8 @@ const Register = () => {
setLoadingMessage("CHECKING_BALANCE");

const canProceed = await checkMinBalance(
fdpClient.account.wallet?.address as string,
minBalance
fdpClient.account.wallet?.address as string,
minBalance
);

if (!canProceed) {
Expand Down Expand Up @@ -330,16 +333,11 @@ const Register = () => {
};

const reset = () => {
setData(emptyState);
setError(null);
setLoadingMessage(null);
if (!data.account) {
registerUser();
} else if (data.balance) {
onPaymentConfirmed(data.balance);
} else {
setStep(Steps.WaitingPayment);
}
setStep(Steps.Loading);

registerUser();
};

useEffect(() => {
Expand Down

0 comments on commit e0f0ae6

Please sign in to comment.