Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLO-739 fix: 2fa state transition #1768

Merged
merged 2 commits into from
Feb 21, 2023
Merged

Conversation

simonheys
Copy link
Collaborator

@simonheys simonheys commented Feb 16, 2023

Issue / feature description

Fixes an issue where the 'live' state of 2FA on account was not in sync with on-chain state and would show momentarily in the wrong state

Changes

  • add a hook to react to both tx and on-chain state, resolving when on-chain state is updated
  • also display tx failure

Checklist

  • Rebased to the last commit of the target branch (or merged)
  • Code self-reviewed
  • Code self-tested
  • Tests updated (if needed)
  • All tests are passing locally

@simonheys simonheys changed the title BLO-739 fix: state transition BLO-739 fix: 2fa state transition Feb 16, 2023
@simonheys simonheys marked this pull request as ready for review February 16, 2023 13:32
@github-actions
Copy link

Builds for local testing

@github-actions
Copy link

Builds for local testing

@github-actions
Copy link

Builds for local testing

return "Two-factor account protection"
}, [isAdding, status])

const shieldIsLoading = liveAccountGuardianState.status === "PENDING"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in a usememo no ?

Copy link
Collaborator Author

@simonheys simonheys Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe is okay if it's not a complex / slow operation, memoizing and checking the memo may well make it slower. More about 'expensive' calculations here: https://beta.reactjs.org/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state

}
}
if (status === "PENDING") {
return {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb instead of having ternaries everywhere we can have just one if ?

@simonheys simonheys merged commit 0e8a7f3 into develop Feb 21, 2023
@simonheys simonheys deleted the fix/BLO-739-state-transition branch February 21, 2023 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants