Skip to content

Commit

Permalink
fix mWeb bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Aug 7, 2024
1 parent 8a22131 commit 9da6141
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3231,6 +3231,9 @@ function completeOnboarding(
const isAccountIDOdd = AccountUtils.isAccountIDOddNumber(currentUserAccountID ?? 0);
const targetEmail = isAccountIDOdd ? CONST.EMAIL.NOTIFICATIONS : CONST.EMAIL.CONCIERGE;

// If the target report isn't opened, the permission field will not exist. So we should add the fallback permission for task report
const fallbackPermission = isAccountIDOdd ? [CONST.REPORT.PERMISSIONS.READ] : [CONST.REPORT.PERMISSIONS.READ, CONST.REPORT.PERMISSIONS.WRITE];

const actorAccountID = PersonalDetailsUtils.getAccountIDsByLogins([targetEmail])[0];
const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]);
const {reportID: targetChatReportID = '', policyID: targetChatPolicyID = ''} = targetChatReport ?? {};
Expand Down Expand Up @@ -3346,7 +3349,7 @@ function completeOnboarding(
},
isOptimisticReport: true,
managerID: currentUserAccountID,
permissions: targetChatReport?.permissions,
permissions: targetChatReport?.permissions ?? fallbackPermission,
},
},
{
Expand Down

0 comments on commit 9da6141

Please sign in to comment.