From 49c9ad48610756da0c7c09896f81a02b9c184c91 Mon Sep 17 00:00:00 2001 From: Tomasz Misiukiewicz Date: Tue, 19 Nov 2024 10:42:07 +0100 Subject: [PATCH] remove cachedTotal key --- src/libs/ReportUtils.ts | 2 -- src/libs/actions/IOU.ts | 4 ---- src/types/onyx/Report.ts | 3 --- src/types/utils/whitelistedReportKeys.ts | 1 - 4 files changed, 10 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 373a861f7c2e..a6fa2ee45181 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -441,7 +441,6 @@ type TransactionDetails = { type OptimisticIOUReport = Pick< Report, - | 'cachedTotal' | 'type' | 'chatReportID' | 'currency' @@ -4553,7 +4552,6 @@ function buildOptimisticIOUReport( return { type: CONST.REPORT.TYPE.IOU, - cachedTotal: formattedTotal, chatReportID, currency, managerID: payerAccountID, diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 5b3592407f89..a25eda71666a 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -2613,10 +2613,6 @@ function getUpdateMoneyRequestParams( updatedMoneyRequestReport = IOUUtils.updateIOUOwnerAndTotal(iouReport, updatedReportAction.actorAccountID ?? -1, diff, TransactionUtils.getCurrency(transaction), false, true); } - if (updatedMoneyRequestReport) { - updatedMoneyRequestReport.cachedTotal = CurrencyUtils.convertToDisplayString(updatedMoneyRequestReport.total, transactionDetails?.currency); - } - optimisticData.push( { onyxMethod: Onyx.METHOD.MERGE, diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts index 7eae6affd254..4df489930e23 100644 --- a/src/types/onyx/Report.ts +++ b/src/types/onyx/Report.ts @@ -151,9 +151,6 @@ type Report = OnyxCommon.OnyxValueWithOfflineFeedback< /** The report visibility */ visibility?: RoomVisibility; - /** Report cached total */ - cachedTotal?: string; - /** Invoice room receiver data */ invoiceReceiver?: InvoiceReceiver; diff --git a/src/types/utils/whitelistedReportKeys.ts b/src/types/utils/whitelistedReportKeys.ts index 71510e498854..b3126f07827b 100644 --- a/src/types/utils/whitelistedReportKeys.ts +++ b/src/types/utils/whitelistedReportKeys.ts @@ -34,7 +34,6 @@ type WhitelistedReport = OnyxCommon.OnyxValueWithOfflineFeedback< writeCapability: unknown; type: unknown; visibility: unknown; - cachedTotal: unknown; invoiceReceiver: unknown; lastMessageTranslationKey: unknown; parentReportID: unknown;