1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-28 23:06:37 +01:00
metamask-extension/ui/app/pages/send
Mark Stacey dcc7d29511
Refactor QR scanner to move all error handling within component (#7885)
The QR scanner component error handling would sometimes redirect the
user to the wrong page. It was also confusingly handled in two places;
the action used to open the QR scanner, and the scanner component.
The error handling has now been corrected, simplified, and integrated
into the QR scanner component itself.

The old way of handling an error within the component was to close the
modal, then call the action to open it all over again. This action took
a route parameter, which instructed the action on which route to open
if the fullscreen UI needed to be opened (as the fullscreen UI is the
only one where the browser will show the camera permission prompt).

This redirection worked just fine for handling the initial opening
of the QR scanner modal. But for any subsequent errors the same action
was used with a _default route_, meaning the user could click "try
again" and find themselves on a completely different screen.

Instead, errors now trigger a state change instead of closing and re-
opening the modal. The permission checks in the action have been
integrated into the component as well.

One functional change is that the scenario where you have an invalid
QR code has been made an error. Previously this just showed the error
message below the video preview, but left the user with no way to try
again. There error page has a "Try again" button, so it seemed better
suited as an error. Also the message literally started with "Error:".

Another functional change is that _all_ errors during initialization
will result in the error UI being shown. Previously there was one error
case that would instead log to the console and leave the user stuck.
2020-02-13 16:07:50 -04:00
..
account-list-item Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
send-content Update sinon and proxyquire (#8027) 2020-02-11 17:03:32 -03:30
send-footer Update sinon and proxyquire (#8027) 2020-02-11 17:03:32 -03:30
send-header Update sinon and proxyquire (#8027) 2020-02-11 17:03:32 -03:30
tests Update sinon and proxyquire (#8027) 2020-02-11 17:03:32 -03:30
index.js Add token selection to the send screen (#6445) 2019-04-17 16:45:13 -02:30
send.component.js Switch to full lodash package, and update lodash (#7907) 2020-01-27 12:45:48 -04:00
send.constants.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
send.container.js Refactor QR scanner to move all error handling within component (#7885) 2020-02-13 16:07:50 -04:00
send.scss Right-to-left CSS (using module for conversion) (#7072) 2019-09-03 14:47:54 -03:00
send.selectors.js Remove unused current view related things (#7843) 2020-01-16 13:02:44 -04:00
send.utils.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30