Skip to content

Commit 3457896

Browse files
Merge pull request Expensify#89333 from Expensify/claude-fixToFieldWrongWorkspaceAfterCreateReport
Sync participants when selecting report in handleRegularReportSelection
2 parents 4f5f29d + 75bddfa commit 3457896

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

src/pages/iou/request/step/IOURequestStepReport.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,22 @@ function IOURequestStepReport({route, transaction}: IOURequestStepReportProps) {
106106
}
107107
};
108108

109+
const buildParticipants = (report: OnyxEntry<Report>) => [
110+
{
111+
selected: true,
112+
accountID: 0,
113+
isPolicyExpenseChat: true,
114+
reportID: report?.chatReportID,
115+
policyID: report?.policyID,
116+
},
117+
];
118+
109119
const handleGlobalCreateReport = (item: TransactionGroupListItem) => {
110120
if (!transaction) {
111121
return;
112122
}
113123
const reportOrDraftReportFromValue = getReportOrDraftReport(item.value, undefined, undefined, undefined, allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${item.value}`]);
114-
const participants = [
115-
{
116-
selected: true,
117-
accountID: 0,
118-
isPolicyExpenseChat: true,
119-
reportID: reportOrDraftReportFromValue?.chatReportID,
120-
policyID: reportOrDraftReportFromValue?.policyID,
121-
},
122-
];
124+
const participants = buildParticipants(reportOrDraftReportFromValue);
123125

124126
const currentPolicyID = perDiemOriginalPolicy?.id;
125127
const newPolicyID = reportOrDraftReportFromValue?.policyID;
@@ -169,10 +171,13 @@ function IOURequestStepReport({route, transaction}: IOURequestStepReportProps) {
169171
handleGoBack();
170172
InteractionManager.runAfterInteractions(() => {
171173
Navigation.setNavigationActionToMicrotaskQueue(() => {
174+
const participants = buildParticipants(report);
175+
172176
setTransactionReport(
173177
transaction.transactionID,
174178
{
175179
reportID: item.value,
180+
participants,
176181
},
177182
!isEditing,
178183
);

0 commit comments

Comments
 (0)