Skip to content

Commit

Permalink
Add unvalidated user check for timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
allgandalf committed Apr 1, 2024
1 parent b282693 commit cc4352a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, '');
Expand Down

0 comments on commit cc4352a

Please sign in to comment.