Skip to content

Commit

Permalink
feat: improve userdata update
Browse files Browse the repository at this point in the history
  • Loading branch information
Soarecos committed Jun 8, 2022
1 parent 5767042 commit 419ca64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/TwoFactorAuth/TwoFactorAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ function TwoFactorAuth() {
if (!isRequestInProgress) {
setIsRequestInProgress(true);
setOtpInputInfo("");
if (apiCall && apiData) {
if (apiData) {
apiCall(apiData)
.then(() => {
if (twoFactorType === TWO_FACTOR_TYPES.APP) {
Expand All @@ -435,7 +435,6 @@ function TwoFactorAuth() {
if (triggerNextStep) triggerNextStep();
}
setIsRequestInProgress(false);
updateUserData();
})
.catch((error: any) => {
if (error.message === FETCH_ERRORS.BAD_REQUEST) {
Expand All @@ -448,6 +447,7 @@ function TwoFactorAuth() {
setIsSwitchChecked(false);
}
});
updateUserData();
}
}
},
Expand Down

0 comments on commit 419ca64

Please sign in to comment.