Skip to content

Commit

Permalink
Merge pull request #51534 from NJ-2020/fix/51128
Browse files Browse the repository at this point in the history
fix report preview optimistic actorAccountID
  • Loading branch information
chiragsalian authored Oct 30, 2024
2 parents f878a07 + 9cbbd2b commit b5561d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5051,6 +5051,7 @@ function buildOptimisticReportPreview(
const hasReceipt = TransactionUtils.hasReceipt(transaction);
const message = getReportPreviewMessage(iouReport);
const created = DateUtils.getDBTime();
const reportActorAccountID = (isInvoiceReport(iouReport) ? iouReport?.ownerAccountID : iouReport?.managerID) ?? -1;
return {
reportActionID: reportActionID ?? NumberUtils.rand64(),
reportID: chatReport?.reportID,
Expand All @@ -5070,7 +5071,7 @@ function buildOptimisticReportPreview(
created,
accountID: iouReport?.managerID ?? -1,
// The preview is initially whispered if created with a receipt, so the actor is the current user as well
actorAccountID: hasReceipt ? currentUserAccountID : iouReport?.managerID ?? -1,
actorAccountID: hasReceipt ? currentUserAccountID : reportActorAccountID,
childReportID: childReportID ?? iouReport?.reportID,
childMoneyRequestCount: 1,
childLastMoneyRequestComment: comment,
Expand Down

0 comments on commit b5561d9

Please sign in to comment.