From 77584d8d0569d3c5033704d4368021b88ffc2afa Mon Sep 17 00:00:00 2001 From: LazyAfternoons Date: Wed, 29 Nov 2023 15:01:19 +0100 Subject: [PATCH] fix(IT Wallet): [SIW-570] Blocking error screen in wallet home screen (#5259) ## Short description This PR fixes a blocking error screen in the wallet home screen. It's shown when the decode of the PID fails. That's not supposed to happen but sometimes it does due to dirty state which we are currently not migrating. ## List of changes proposed in this pull request - Replaces the old error view with a new one which has a reset button and doesn't block the wallet usage. ## How to test Static checks should be enough. Co-authored-by: Mario Perrotta --- .../it-wallet/screens/ItwHomeScreen.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/ts/features/it-wallet/screens/ItwHomeScreen.tsx b/ts/features/it-wallet/screens/ItwHomeScreen.tsx index 4ee09cce12d..0ae0341ae61 100644 --- a/ts/features/it-wallet/screens/ItwHomeScreen.tsx +++ b/ts/features/it-wallet/screens/ItwHomeScreen.tsx @@ -28,8 +28,6 @@ import { useItwResetFlow } from "../hooks/useItwResetFlow"; import ItwCredentialCard from "../components/ItwCredentialCard"; import { CredentialType, getPidDisplayData } from "../utils/mocks"; import ItwKoView from "../components/ItwKoView"; -import { getItwGenericMappedError } from "../utils/errors/itwErrorsMapping"; -import { ItWalletError } from "../utils/errors/itwErrors"; const contextualHelpMarkdown: ContextualHelpPropsMarkdown = { title: "wallet.contextualHelpTitle", @@ -168,20 +166,23 @@ const ItwHomeScreen = () => { ); - /** - * Error view component which currently displays a generic error. - * @param error - optional ItWalletError to be displayed. - */ - const ErrorView = ({ error: _ }: { error?: ItWalletError }) => { - const mappedError = getItwGenericMappedError(() => navigation.goBack()); - return ; - }; - const RenderMask = () => pipe( decodedPid, O.fold( - () => , + () => ( + present() + }} + /> + ), some => ) );