1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 19:10:22 +01:00
metamask-extension/ui/app/pages/settings/contact-list-tab
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
..
add-contact Refactor QR scanner to move all error handling within component (#7885) 2020-02-13 16:07:50 -04:00
edit-contact eslint: Enable more react/jsx-* rules (#7592) 2019-12-03 13:05:44 -03:30
my-accounts Address book send plus contact list (#6914) 2019-07-31 17:26:44 -02:30
view-contact Add react/no-unused-prop-types ESLint rule (#7655) 2019-12-07 23:10:47 -04:00
contact-list-tab.component.js eslint: Enable more react/jsx-* rules (#7592) 2019-12-03 13:05:44 -03:30
contact-list-tab.container.js Address book send plus contact list (#6914) 2019-07-31 17:26:44 -02:30
index.js Address book send plus contact list (#6914) 2019-07-31 17:26:44 -02:30
index.scss Adjust copy-to-clipboard svg width and height on edit contact screen 2019-10-29 16:14:18 -07:00