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

Remove whisper from report preview #45652

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 1 addition & 7 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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 @@ -4117,7 +4117,6 @@ function buildOptimisticIOUReportAction(
iouReportID = '',
isSettlingUp = false,
isSendMoneyFlow = false,
receipt: Receipt = {},
isOwnPolicyExpenseChat = false,
created = DateUtils.getDBTime(),
linkedExpenseReportAction?: OnyxEntry<ReportAction>,
Expand All @@ -4131,7 +4130,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 @@ -4342,7 +4340,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 @@ -4352,7 +4349,6 @@ function buildOptimisticReportPreview(
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
originalMessage: {
linkedReportID: iouReport?.reportID,
whisperedTo: isReceiptBeingScanned ? [currentUserAccountID ?? -1] : [],
},
message: [
{
Expand Down Expand Up @@ -5202,7 +5198,6 @@ function buildOptimisticMoneyRequestEntities(
paymentType?: PaymentMethodType,
isSettlingUp = false,
isSendMoneyFlow = false,
receipt: Receipt = {},
isOwnPolicyExpenseChat = false,
isPersonalTrackingExpense?: boolean,
existingTransactionThreadReportID?: string,
Expand All @@ -5225,7 +5220,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
Loading