Skip to content

Commit

Permalink
Merge pull request #932 from singnet/package-updating
Browse files Browse the repository at this point in the history
fixed account page and resending verification code
  • Loading branch information
MarinaFedy authored Aug 13, 2024
2 parents 9a4d8b9 + 7e56fec commit fa615ad
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/Login/Signup/RenderOTP.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const RenderOTP = ({ classes, otp, handleOTP, handleResendOTP, handleConfirmSign
onChange={handleOTP}
autoFocus
/>
<AlertBox type={alert.type} message={alert.message} />
{alert && <AlertBox type={alert.type} message={alert.message} />}
<div className={classes.buttonsContainer}>
<StyledButton type="transparent" btnText="Resend" onClick={handleResendOTP} />
<StyledButton type="blue" btnText="Continue" onClick={handleConfirmSignup} />
Expand Down
3 changes: 1 addition & 2 deletions src/components/Login/Signup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,13 @@ const SignUp = ({ classes }) => {
})
.catch((e) => {
console.log("e: ", e);

setAlert({ type: alertTypes.ERROR, message: "email confirmation failed. Please try again" });
});
};

const handleResendVerificationCode = () => {
setAlert({});
resendSignUpCode(email)
resendSignUpCode({ username: email })
.then(() => {
setAlert({ type: alertTypes.SUCCESS, message: "code resent successfully" });
})
Expand Down
20 changes: 13 additions & 7 deletions src/components/UserProfile/UserProfileAccount/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ const UserProfileAccount = ({ classes }) => {
const dispatch = useDispatch();

useEffect(() => {
const availableWallets = dispatch(fetchAvailableUserWallets());
const enhancedWallets = map(availableWallets, ({ address, type }) => {
return { address, type, value: address, label: `${type} (${address})` };
});
setWallets(enhancedWallets);
const sdk = dispatch(sdkActions.getSdk());
setCurrentAddress(sdk.account.getAddress());
const fetchWallets = async () => {
const availableWallets = await dispatch(fetchAvailableUserWallets());
const enhancedWallets = map(availableWallets, ({ address, type }) => {
return { address, type, value: address, label: `${type} (${address})` };
});
setWallets(enhancedWallets);
};
const getCurrentMetamaskAddress = async () => {
const sdk = await dispatch(sdkActions.getSdk());
setCurrentAddress(await sdk.account.getAddress());
};
getCurrentMetamaskAddress();
fetchWallets();
}, [dispatch]);

const isSameMetaMaskAddress = (address) => {
Expand Down

0 comments on commit fa615ad

Please sign in to comment.