From eed7c44337ceaf617b5fa235afeb40dd1c103cf0 Mon Sep 17 00:00:00 2001 From: Radek Czemerys Date: Tue, 15 Sep 2020 14:32:31 +0200 Subject: [PATCH] fix: update authentication label for registration & login --- src/screens/Authenticate/Authenticate.tsx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/screens/Authenticate/Authenticate.tsx b/src/screens/Authenticate/Authenticate.tsx index 235ae984..80f3d87d 100644 --- a/src/screens/Authenticate/Authenticate.tsx +++ b/src/screens/Authenticate/Authenticate.tsx @@ -42,10 +42,12 @@ import { type Props = ModalStackNavigationProp; -export const STRING_ENTER_PASSCODE_FOR_MIGRATION = +const STRING_ENTER_PASSCODE_FOR_MIGRATION = 'Your application passcode is required to perform an upgrade of your local data storage structure.'; -export const STRING_AUTHENTICATION_REQUIRED = +const STRING_AUTHENTICATION_REQUIRED = 'Authentication is required to unlock application.'; +const STRING_ENTER_PASSCODE_FOR_LOGIN_REGISTER = + 'Enter your application passcode before signing in or registering.'; export const Authenticate = ({ route: { @@ -525,13 +527,16 @@ export const Authenticate = ({ [challengeValueStates] ); - const textData = useMemo( - () => - challenge.reason === ChallengeReason.Migration - ? STRING_ENTER_PASSCODE_FOR_MIGRATION - : STRING_AUTHENTICATION_REQUIRED, - [challenge.reason] - ); + const textData = useMemo(() => { + switch (challenge.reason) { + case ChallengeReason.Migration: + return STRING_ENTER_PASSCODE_FOR_MIGRATION; + case ChallengeReason.ResaveRootKey: + return STRING_ENTER_PASSCODE_FOR_LOGIN_REGISTER; + default: + return STRING_AUTHENTICATION_REQUIRED; + } + }, [challenge.reason]); return (