Skip to content

Commit

Permalink
currentUserAccountID as actor
Browse files Browse the repository at this point in the history
  • Loading branch information
c3024 committed Nov 18, 2024
1 parent 45b5d17 commit c0ee29f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3494,7 +3494,7 @@ function prepareOnboardingOptimisticData(
}

const integrationName = userReportedIntegration ? CONST.ONBOARDING_ACCOUNTING_MAPPING[userReportedIntegration] : '';
const actorAccountID = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? CONST.ACCOUNT_ID.QA_GUIDE : CONST.ACCOUNT_ID.CONCIERGE;
const actorAccountID = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? currentUserAccountID : CONST.ACCOUNT_ID.CONCIERGE;
const adminsChatReport = ReportConnection.getAllReports()?.[`${ONYXKEYS.COLLECTION.REPORT}${adminsChatReportID}`];
const targetChatReport = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? adminsChatReport : ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]);
const {reportID: targetChatReportID = '', policyID: targetChatPolicyID = ''} = targetChatReport ?? {};
Expand Down Expand Up @@ -3567,7 +3567,7 @@ function prepareOnboardingOptimisticData(
targetChatPolicyID,
CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
);
const emailCreatingAction = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? CONST.EMAIL.QA_GUIDE : CONST.EMAIL.CONCIERGE;
const emailCreatingAction = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? currentUserEmail ?? CONST.EMAIL.CONCIERGE : CONST.EMAIL.CONCIERGE;
const taskCreatedAction = ReportUtils.buildOptimisticCreatedReportAction(emailCreatingAction);
const taskReportAction = ReportUtils.buildOptimisticTaskCommentReportAction(
currentTask.reportID,
Expand Down
24 changes: 12 additions & 12 deletions src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE

const [allPersonalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);

const setOptimticQAGuidePersonalDetail = () => {
const actorAccountID = CONST.ACCOUNT_ID.QA_GUIDE;
const optimisticPersonalDetailForQAGuide = {
accountID: actorAccountID,
avatar: allPersonalDetails?.[actorAccountID]?.avatar,
displayName: allPersonalDetails?.[actorAccountID]?.displayName ?? CONST.EMAIL.QA_GUIDE,
login: CONST.EMAIL.QA_GUIDE,
};
// eslint-disable-next-line rulesdir/prefer-actions-set-data
Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, {[actorAccountID]: optimisticPersonalDetailForQAGuide});
};
// const setOptimticQAGuidePersonalDetail = () => {
// const actorAccountID = CONST.ACCOUNT_ID.QA_GUIDE;
// const optimisticPersonalDetailForQAGuide = {
// accountID: actorAccountID,
// avatar: allPersonalDetails?.[actorAccountID]?.avatar,
// displayName: allPersonalDetails?.[actorAccountID]?.displayName ?? CONST.EMAIL.QA_GUIDE,
// login: CONST.EMAIL.QA_GUIDE,
// };
// // eslint-disable-next-line rulesdir/prefer-actions-set-data
// Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, {[actorAccountID]: optimisticPersonalDetailForQAGuide});
// };

const footerContent = (
<>
Expand All @@ -81,7 +81,7 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
const {adminsChatReportID, policyID} = Policy.createWorkspace(undefined, true, '', Policy.generatePolicyID(), CONST.ONBOARDING_CHOICES.MANAGE_TEAM);
Welcome.setOnboardingAdminsChatReportID(adminsChatReportID);
Welcome.setOnboardingPolicyID(policyID);
setOptimticQAGuidePersonalDetail();
// setOptimticQAGuidePersonalDetail();
}

Navigation.navigate(ROUTES.ONBOARDING_ACCOUNTING.getRoute(route.params?.backTo));
Expand Down

0 comments on commit c0ee29f

Please sign in to comment.