diff --git a/src/languages/en.ts b/src/languages/en.ts index eaf22051dd12..4dc24f5bcec3 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1463,6 +1463,7 @@ export default { error: { containsReservedWord: 'Name cannot contain the words Expensify or Concierge.', hasInvalidCharacter: 'Name cannot contain a comma or semicolon.', + requiredFirstName: 'First name cannot be empty.', }, }, privatePersonalDetails: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 87369d407d77..48229be41a5f 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1464,6 +1464,7 @@ export default { error: { containsReservedWord: 'El nombre no puede contener las palabras Expensify o Concierge.', hasInvalidCharacter: 'El nombre no puede contener una coma o un punto y coma.', + requiredFirstName: 'El nombre no puede estar vacĂ­o.', }, }, privatePersonalDetails: { diff --git a/src/pages/settings/Profile/DisplayNamePage.tsx b/src/pages/settings/Profile/DisplayNamePage.tsx index e338fc16b0ee..90f7ca3abbd6 100644 --- a/src/pages/settings/Profile/DisplayNamePage.tsx +++ b/src/pages/settings/Profile/DisplayNamePage.tsx @@ -50,6 +50,8 @@ function DisplayNamePage({isLoadingApp = true, currentUserPersonalDetails}: Disp ErrorUtils.addErrorMessage(errors, 'firstName', translate('personalDetails.error.hasInvalidCharacter')); } else if (values.firstName.length > CONST.TITLE_CHARACTER_LIMIT) { ErrorUtils.addErrorMessage(errors, 'firstName', translate('common.error.characterLimitExceedCounter', {length: values.firstName.length, limit: CONST.TITLE_CHARACTER_LIMIT})); + } else if (values.firstName.length === 0) { + ErrorUtils.addErrorMessage(errors, 'firstName', translate('personalDetails.error.requiredFirstName')); } if (ValidationUtils.doesContainReservedWord(values.firstName, CONST.DISPLAY_NAME.RESERVED_NAMES)) { ErrorUtils.addErrorMessage(errors, 'firstName', translate('personalDetails.error.containsReservedWord'));