From cc4352ae5c9e59ec2155720a97ab362e21635fc4 Mon Sep 17 00:00:00 2001 From: GandalfGwaihir Date: Tue, 2 Apr 2024 04:46:49 +0530 Subject: [PATCH 1/3] Add unvalidated user check for timezone --- src/pages/ProfilePage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index f3c2840d5586..270b72b93da8 100755 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -90,10 +90,12 @@ function ProfilePage({personalDetails, personalDetailsMetadata, route, session, const fallbackIcon = details?.fallbackIcon ?? ''; const login = details?.login ?? ''; const timezone = details?.timezone; + const reportRecipient = personalDetails?.[accountID]; + const isParticipantValidated = reportRecipient?.validated ?? false; // If we have a reportID param this means that we // arrived here via the ParticipantsPage and should be allowed to navigate back to it - const shouldShowLocalTime = !ReportUtils.hasAutomatedExpensifyAccountIDs([accountID]) && !isEmptyObject(timezone); + const shouldShowLocalTime = !ReportUtils.hasAutomatedExpensifyAccountIDs([accountID]) && !isEmptyObject(timezone) && isParticipantValidated; let pronouns = details?.pronouns ?? ''; if (pronouns?.startsWith(CONST.PRONOUNS.PREFIX)) { const localeKey = pronouns.replace(CONST.PRONOUNS.PREFIX, ''); From d49329f97dbe1f80f6ad561ab6d84f01e50981fb Mon Sep 17 00:00:00 2001 From: GandalfGwaihir Date: Tue, 2 Apr 2024 04:49:15 +0530 Subject: [PATCH 2/3] remove null check as value can be undefined --- src/pages/ProfilePage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 270b72b93da8..aa93b94e0e9f 100755 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -91,7 +91,8 @@ function ProfilePage({personalDetails, personalDetailsMetadata, route, session, const login = details?.login ?? ''; const timezone = details?.timezone; const reportRecipient = personalDetails?.[accountID]; - const isParticipantValidated = reportRecipient?.validated ?? false; + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + const isParticipantValidated = reportRecipient?.validated || false; // If we have a reportID param this means that we // arrived here via the ParticipantsPage and should be allowed to navigate back to it From 6b7e935737b43e2135929caf87aa3ff34fccf196 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Thu, 4 Apr 2024 23:34:55 +0530 Subject: [PATCH 3/3] Update src/pages/ProfilePage.tsx Co-authored-by: Aldo Canepa Garay <87341702+aldo-expensify@users.noreply.github.com> --- src/pages/ProfilePage.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index aa93b94e0e9f..270b72b93da8 100755 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -91,8 +91,7 @@ function ProfilePage({personalDetails, personalDetailsMetadata, route, session, const login = details?.login ?? ''; const timezone = details?.timezone; const reportRecipient = personalDetails?.[accountID]; - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - const isParticipantValidated = reportRecipient?.validated || false; + const isParticipantValidated = reportRecipient?.validated ?? false; // If we have a reportID param this means that we // arrived here via the ParticipantsPage and should be allowed to navigate back to it