Skip to content

Commit

Permalink
Merge pull request #52806 from callstack-internal/refactor/remove-cac…
Browse files Browse the repository at this point in the history
…hedTotal

[No QA] remove cachedTotal key
  • Loading branch information
puneetlath authored Nov 21, 2024
2 parents d49d52d + 49c9ad4 commit 056d654
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ type TransactionDetails = {

type OptimisticIOUReport = Pick<
Report,
| 'cachedTotal'
| 'type'
| 'chatReportID'
| 'currency'
Expand Down Expand Up @@ -4553,7 +4552,6 @@ function buildOptimisticIOUReport(

return {
type: CONST.REPORT.TYPE.IOU,
cachedTotal: formattedTotal,
chatReportID,
currency,
managerID: payerAccountID,
Expand Down
4 changes: 0 additions & 4 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2617,10 +2617,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,
Expand Down
3 changes: 0 additions & 3 deletions src/types/onyx/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ type Report = OnyxCommon.OnyxValueWithOfflineFeedback<
/** The report visibility */
visibility?: RoomVisibility;

/** Report cached total */
cachedTotal?: string;

/** Invoice room receiver data */
invoiceReceiver?: InvoiceReceiver;

Expand Down
1 change: 0 additions & 1 deletion src/types/utils/whitelistedReportKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type WhitelistedReport = OnyxCommon.OnyxValueWithOfflineFeedback<
writeCapability: unknown;
type: unknown;
visibility: unknown;
cachedTotal: unknown;
invoiceReceiver: unknown;
lastMessageTranslationKey: unknown;
parentReportID: unknown;
Expand Down

0 comments on commit 056d654

Please sign in to comment.