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

Use async/await for "message manager" action creators #8434

Merged

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Apr 28, 2020

These action creators for the "message manager" controller interactions have been updated to use async/await. There should be almost no changes in behavior. The only things removed were a few debug log statements, and a single console.log.

@Gudahtt Gudahtt force-pushed the use-async-await-in-action-creators-that-update-metamask-state branch from 3b3a505 to 2f995de Compare April 28, 2020 02:32
@Gudahtt Gudahtt marked this pull request as ready for review April 28, 2020 03:33
@Gudahtt Gudahtt requested a review from a team as a code owner April 28, 2020 03:33
@metamaskbot
Copy link
Collaborator

Builds ready [2f995de]

@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 28, 2020

I had done this originally in preparation for allowing updateMetamaskState to be async, but it turns out that I don't need that anymore. It's still nice to use async/await over the Promise constructor though, so I'll leave this up and update the PR description to remove my original reason, since it no longer applies.

These action creators for the "message manager" controller
interactions have been updated to use `async/await`. There should be
almost no changes in behavior. The only things removed were a few debug
log statements, and a single `console.log`.
@Gudahtt Gudahtt force-pushed the use-async-await-in-action-creators-that-update-metamask-state branch from 2f995de to 12a4c3d Compare April 28, 2020 03:51
@Gudahtt Gudahtt changed the title Use async/await for action creators that call updateMetamaskState Use async/await for "message manager" action creators Apr 28, 2020
@metamaskbot
Copy link
Collaborator

Builds ready [12a4c3d]

Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

LGTM! Good use of the finally-block to tidy up the logic.

@Gudahtt Gudahtt merged commit 580a90d into develop Apr 28, 2020
@Gudahtt Gudahtt deleted the use-async-await-in-action-creators-that-update-metamask-state branch April 28, 2020 12:49
Gudahtt added a commit that referenced this pull request Jul 15, 2020
The loading indication had remained after successfully signing with
`personal_sign`. This mistake was introduced accidentally in #8434.

This is noticeable if you confirm the signature in the popup UI or
fullscreen UI, as they remain open after signing. The notification UI
closes after signing without waiting for this loading indicator to be
removed.
Gudahtt added a commit that referenced this pull request Jul 16, 2020
The loading indication had remained after successfully signing with
`personal_sign`. This mistake was introduced accidentally in #8434.

This is noticeable if you confirm the signature in the popup UI or
fullscreen UI, as they remain open after signing. The notification UI
closes after signing without waiting for this loading indicator to be
removed.
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