Skip to content

Commit

Permalink
Merge pull request #42260 from rezkiy37/fix/40977-merge-account-name
Browse files Browse the repository at this point in the history
Replace the "MERGED_" prefix correctly
  • Loading branch information
chiragsalian authored May 24, 2024
2 parents 2f16abb + baed85e commit c699735
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const onboardingChoices = {
type OnboardingPurposeType = ValueOf<typeof onboardingChoices>;

const CONST = {
MERGED_ACCOUNT_PREFIX: 'MERGED_',
DEFAULT_POLICY_ROOM_CHAT_TYPES: [chatTypes.POLICY_ADMINS, chatTypes.POLICY_ANNOUNCE, chatTypes.DOMAIN_ALL],

// Note: Group and Self-DM excluded as these are not tied to a Workspace
Expand Down
4 changes: 2 additions & 2 deletions src/libs/PersonalDetailsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ function getDisplayNameOrDefault(passedPersonalDetails?: Partial<PersonalDetails
let displayName = passedPersonalDetails?.displayName ?? '';

// If the displayName starts with the merged account prefix, remove it.
if (displayName.startsWith(CONST.MERGED_ACCOUNT_PREFIX)) {
if (new RegExp(CONST.REGEX.MERGED_ACCOUNT_PREFIX).test(displayName)) {
// Remove the merged account prefix from the displayName.
displayName = displayName.substring(CONST.MERGED_ACCOUNT_PREFIX.length);
displayName = displayName.replace(CONST.REGEX.MERGED_ACCOUNT_PREFIX, '');
}

// If the displayName is not set by the user, the backend sets the diplayName same as the login so
Expand Down

0 comments on commit c699735

Please sign in to comment.