1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/ui/app/pages
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-token Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
confirm-add-suggested-token Purge xtend from the UI (#7795) 2020-01-13 12:59:21 -03:30
confirm-add-token Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
confirm-approve Validate custom spend limit (#7920) 2020-01-29 14:16:38 -04:00
confirm-deploy-contract Disable unnecessary curly braces in JSX (#7454) 2019-11-18 11:38:47 -03:30
confirm-send-ether Disable unnecessary curly braces in JSX (#7454) 2019-11-18 11:38:47 -03:30
confirm-send-token Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
confirm-token-transaction-base Fix confirm token transaction amount display (#7081) 2019-08-31 13:26:49 -03:00
confirm-transaction Use combineReducers for rootReducer (#7964) 2020-02-06 13:08:14 -03:30
confirm-transaction-base Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
confirm-transaction-switch Fix batch transaction UX (#7473) 2020-01-10 06:34:02 -08:00
connected-sites Connect distinct accounts per site (#7004) 2019-12-03 09:35:56 -08:00
create-account Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
error Add top-level error page (#7889) 2020-01-24 17:11:02 -04:00
first-time-flow Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
home Remove unnecessary get environment type parameter (#7891) 2020-01-24 15:12:58 -04:00
keychains Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
lock Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
mobile-sync Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
permissions-connect Remove unnecessary get environment type parameter (#7891) 2020-01-24 15:12:58 -04:00
routes Change "Log In/Out" terminology to "Unlock/Lock" (#7853) 2020-01-21 14:09:53 -08:00
send Refactor QR scanner to move all error handling within component (#7885) 2020-02-13 16:07:50 -04:00
settings Refactor QR scanner to move all error handling within component (#7885) 2020-02-13 16:07:50 -04:00
unlock-page Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
index.js Add top-level error page (#7889) 2020-01-24 17:11:02 -04:00
index.scss Add top-level error page (#7889) 2020-01-24 17:11:02 -04:00