Skip to content

Commit

Permalink
Merge pull request #56370 from ishpaul777/fix-db-56351
Browse files Browse the repository at this point in the history
[fix] Setup specialist appears in member list and throws error when invited
  • Loading branch information
MarioExpensify authored Feb 4, 2025
2 parents 1e4ff8a + e1bf1f9 commit 6486b1d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6570,6 +6570,7 @@ const CONST = {
},
},
SKIPPABLE_COLLECTION_MEMBER_IDS: [String(DEFAULT_NUMBER_ID), '-1', 'undefined', 'null', 'NaN'] as string[],
SETUP_SPECIALIST_LOGIN: 'Setup Specialist',
} as const;

type Country = keyof typeof CONST.ALL_COUNTRIES;
Expand Down
9 changes: 8 additions & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,14 @@ function getValidOptions(
for (let i = 0; i < options.personalDetails.length; i++) {
// eslint-disable-next-line rulesdir/prefer-at
const detail = options.personalDetails[i];
if (!detail?.login || !detail.accountID || !!detail?.isOptimisticPersonalDetail || (!includeDomainEmail && Str.isDomainEmail(detail.login))) {
if (
!detail?.login ||
!detail.accountID ||
!!detail?.isOptimisticPersonalDetail ||
(!includeDomainEmail && Str.isDomainEmail(detail.login)) ||
// Exclude the setup specialist from the list of personal details as it's a fallback if guide is not assigned
detail?.login === CONST.SETUP_SPECIALIST_LOGIN
) {
continue;
}

Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3664,6 +3664,7 @@ function prepareOnboardingOnyxData(
assignedGuideAccountID = generateAccountID(assignedGuideEmail);
Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, {
[assignedGuideAccountID]: {
isOptimisticPersonalDetail: assignedGuideEmail === CONST.SETUP_SPECIALIST_LOGIN,
login: assignedGuideEmail,
displayName: assignedGuideEmail,
},
Expand Down

0 comments on commit 6486b1d

Please sign in to comment.