From 7f4d5d0c6ba4b4fdb005eab6b231d7a95ce30e67 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Fri, 19 Apr 2024 21:04:26 +0200 Subject: [PATCH] Use correct, new transactions backup key --- src/pages/iou/request/step/IOURequestStepAmount.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 2cc59bf0af14..f4abc90bd315 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -39,8 +39,8 @@ type IOURequestStepAmountOnyxProps = { /** Whether the confirmation step should be skipped */ skipConfirmation: OnyxEntry; - /** The draft transaction object being modified in Onyx */ - draftTransaction: OnyxEntry; + /** The backup transaction object being modified in Onyx */ + backupTransaction: OnyxEntry; /** Personal details of all users */ personalDetails: OnyxEntry; @@ -66,7 +66,7 @@ function IOURequestStepAmount({ personalDetails, currentUserPersonalDetails, splitDraftTransaction, - draftTransaction, + backupTransaction, skipConfirmation, }: IOURequestStepAmountProps) { const {translate} = useLocalize(); @@ -79,7 +79,7 @@ function IOURequestStepAmount({ const isSplitBill = iouType === CONST.IOU.TYPE.SPLIT; const isEditingSplitBill = isEditing && isSplitBill; const {amount: transactionAmount} = ReportUtils.getTransactionDetails(isEditingSplitBill && !isEmptyObject(splitDraftTransaction) ? splitDraftTransaction : transaction) ?? {amount: 0}; - const {currency: originalCurrency} = ReportUtils.getTransactionDetails(isEditing ? draftTransaction : transaction) ?? {currency: CONST.CURRENCY.USD}; + const {currency: originalCurrency} = ReportUtils.getTransactionDetails(isEditing ? backupTransaction : transaction) ?? {currency: CONST.CURRENCY.USD}; const currency = CurrencyUtils.isValidCurrencyCode(selectedCurrency) ? selectedCurrency : originalCurrency; // For quick button actions, we'll skip the confirmation page unless the report is archived or this is a workspace request, as @@ -266,10 +266,10 @@ const IOURequestStepAmountWithOnyx = withOnyx { const transactionID = route.params.transactionID ?? 0; - return `${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`; + return `${ONYXKEYS.COLLECTION.TRANSACTION_BACKUP}${transactionID}`; }, }, skipConfirmation: {