Skip to content

Commit

Permalink
Merge pull request #45652 from Expensify/youssef_remove_whisper_from_…
Browse files Browse the repository at this point in the history
…report_preview

Remove whisper from report preview
  • Loading branch information
youssef-lr authored Jul 18, 2024
2 parents ca04970 + 40220ee commit 1dd2d56
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
8 changes: 1 addition & 7 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import type {Status} from '@src/types/onyx/PersonalDetails';
import type {ConnectionName} from '@src/types/onyx/Policy';
import type {NotificationPreference, Participants, PendingChatMember, Participant as ReportParticipant} from '@src/types/onyx/Report';
import type {Message, ReportActions} from '@src/types/onyx/ReportAction';
import type {Comment, Receipt, TransactionChanges, WaypointCollection} from '@src/types/onyx/Transaction';
import type {Comment, TransactionChanges, WaypointCollection} from '@src/types/onyx/Transaction';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import type IconAsset from '@src/types/utils/IconAsset';
import AccountUtils from './AccountUtils';
Expand Down Expand Up @@ -4118,7 +4118,6 @@ function buildOptimisticIOUReportAction(
iouReportID = '',
isSettlingUp = false,
isSendMoneyFlow = false,
receipt: Receipt = {},
isOwnPolicyExpenseChat = false,
created = DateUtils.getDBTime(),
linkedExpenseReportAction?: OnyxEntry<ReportAction>,
Expand All @@ -4132,7 +4131,6 @@ function buildOptimisticIOUReportAction(
IOUTransactionID: transactionID,
IOUReportID,
type,
whisperedTo: [CONST.IOU.RECEIPT_STATE.SCANREADY, CONST.IOU.RECEIPT_STATE.SCANNING].some((value) => value === receipt?.state) ? [currentUserAccountID ?? -1] : [],
};

if (type === CONST.IOU.REPORT_ACTION_TYPE.PAY) {
Expand Down Expand Up @@ -4343,7 +4341,6 @@ function buildOptimisticReportPreview(
childReportID?: string,
): ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW> {
const hasReceipt = TransactionUtils.hasReceipt(transaction);
const isReceiptBeingScanned = hasReceipt && TransactionUtils.isReceiptBeingScanned(transaction);
const message = getReportPreviewMessage(iouReport);
const created = DateUtils.getDBTime();
return {
Expand All @@ -4353,7 +4350,6 @@ function buildOptimisticReportPreview(
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
originalMessage: {
linkedReportID: iouReport?.reportID,
whisperedTo: isReceiptBeingScanned ? [currentUserAccountID ?? -1] : [],
},
message: [
{
Expand Down Expand Up @@ -5203,7 +5199,6 @@ function buildOptimisticMoneyRequestEntities(
paymentType?: PaymentMethodType,
isSettlingUp = false,
isSendMoneyFlow = false,
receipt: Receipt = {},
isOwnPolicyExpenseChat = false,
isPersonalTrackingExpense?: boolean,
existingTransactionThreadReportID?: string,
Expand All @@ -5226,7 +5221,6 @@ function buildOptimisticMoneyRequestEntities(
isPersonalTrackingExpense ? '0' : iouReport.reportID,
isSettlingUp,
isSendMoneyFlow,
receipt,
isOwnPolicyExpenseChat,
iouActionCreationTime,
linkedTrackedExpenseReportAction,
Expand Down
5 changes: 0 additions & 5 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,6 @@ function getSendInvoiceInformation(
undefined,
false,
false,
receiptObject,
false,
);
const reportPreviewAction = ReportUtils.buildOptimisticReportPreview(chatReport, optimisticInvoiceReport, trimmedComment, optimisticTransaction);
Expand Down Expand Up @@ -2033,7 +2032,6 @@ function getMoneyRequestInformation(
undefined,
false,
false,
receiptObject,
false,
undefined,
linkedTrackedExpenseReportAction?.childReportID,
Expand Down Expand Up @@ -2259,7 +2257,6 @@ function getTrackExpenseInformation(
undefined,
false,
false,
receiptObject,
false,
!shouldUseMoneyReport,
linkedTrackedExpenseReportAction?.childReportID,
Expand Down Expand Up @@ -3923,7 +3920,6 @@ function createSplitsAndOnyxData(
'',
false,
false,
{},
isOwnPolicyExpenseChat,
);

Expand Down Expand Up @@ -4504,7 +4500,6 @@ function startSplitBill({
'',
false,
false,
receiptObject,
isOwnPolicyExpenseChat,
);

Expand Down
1 change: 0 additions & 1 deletion src/pages/home/report/ReportActionsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ function ReportActionsView({
report.reportID,
false,
false,
{},
false,
DateUtils.subtractMillisecondsFromDateTime(actions[actions.length - 1].created, 1),
) as OnyxTypes.ReportAction;
Expand Down

0 comments on commit 1dd2d56

Please sign in to comment.