Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix report preview optimistic actorAccountID #51534

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5046,6 +5046,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 @@ -5065,7 +5066,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
Loading