fix: appropriate wording for passcode prompt when registering

This commit is contained in:
Baptiste Grob
2020-09-14 12:15:43 +02:00
parent 11f08e6f93
commit 1595ea518e
2 changed files with 10 additions and 4 deletions

View File

@@ -49,6 +49,7 @@ export function StringImportError(errorCount: number) {
export const STRING_ENTER_ACCOUNT_PASSCODE = 'Enter your application passcode to decrypt your data and unlock the application';
export const STRING_ENTER_ACCOUNT_PASSWORD = 'Enter your account password';
export const STRING_ENTER_PASSCODE_FOR_MIGRATION = 'Your application passcode is required to perform an upgrade of your local data storage structure.';
export const STRING_ENTER_PASSCODE_FOR_LOGIN_REGISTER = 'Enter your application passcode before signing in or registering';
export const STRING_STORAGE_UPDATE = 'Storage Update';
export const STRING_AUTHENTICATION_REQUIRED = 'Authentication Required';
export const STRING_UNSUPPORTED_BACKUP_FILE_VERSION = 'This backup file was created using an unsupported version of the application and cannot be imported here. Please update your application and try again.';

View File

@@ -16,7 +16,8 @@ import {
STRING_ENTER_ACCOUNT_PASSWORD,
STRING_ENTER_PASSCODE_FOR_MIGRATION,
STRING_STORAGE_UPDATE,
STRING_AUTHENTICATION_REQUIRED
STRING_AUTHENTICATION_REQUIRED,
STRING_ENTER_PASSCODE_FOR_LOGIN_REGISTER,
} from '@/strings';
type InputValue = {
@@ -132,10 +133,14 @@ class ChallengeModalCtrl extends PureViewCtrl {
promptForChallenge(challenge: ChallengeType): string {
if (challenge === ChallengeType.LocalPasscode) {
if (this.challenge.reason === ChallengeReason.Migration) {
return STRING_ENTER_PASSCODE_FOR_MIGRATION;
switch (this.challenge.reason) {
case ChallengeReason.Migration:
return STRING_ENTER_PASSCODE_FOR_MIGRATION;
case ChallengeReason.ResaveRootKey:
return STRING_ENTER_PASSCODE_FOR_LOGIN_REGISTER;
default:
return STRING_ENTER_ACCOUNT_PASSCODE;
}
return STRING_ENTER_ACCOUNT_PASSCODE;
} else {
return STRING_ENTER_ACCOUNT_PASSWORD;
}