Skip to content

Commit

Permalink
Add an explanatory comment for an early "Hidden" return
Browse files Browse the repository at this point in the history
  • Loading branch information
paultsimura committed Jan 2, 2024
1 parent 0f6fdd3 commit 13edc94
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1439,9 +1439,11 @@ function getDisplayNameForParticipant(accountID?: number, shouldUseShortForm = f
return formattedLogin;
}

const longName = PersonalDetailsUtils.getDisplayNameOrDefault(personalDetails, formattedLogin, false);
if (!longName && shouldFallbackToHidden) {
return Localize.translateLocal('common.hidden');
const longName = PersonalDetailsUtils.getDisplayNameOrDefault(personalDetails, formattedLogin, shouldFallbackToHidden);

// If the user's personal details (first name) should be hidden, make sure we return "hidden" instead of the short name
if (shouldFallbackToHidden && longName === Localize.translateLocal('common.hidden')) {
return longName;
}

const shortName = personalDetails.firstName ? personalDetails.firstName : longName;
Expand Down

0 comments on commit 13edc94

Please sign in to comment.