From dcfd9e7367698c25ea752fa8003e505aac95b204 Mon Sep 17 00:00:00 2001 From: gijoe0295 Date: Tue, 23 Jul 2024 03:52:35 +0700 Subject: [PATCH 01/11] show not found page for invalid report or transaction in review duplicate confirmation page --- .../TransactionDuplicate/Confirmation.tsx | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/src/pages/TransactionDuplicate/Confirmation.tsx b/src/pages/TransactionDuplicate/Confirmation.tsx index 8d2ece49c417..2184c4a2cb31 100644 --- a/src/pages/TransactionDuplicate/Confirmation.tsx +++ b/src/pages/TransactionDuplicate/Confirmation.tsx @@ -4,6 +4,7 @@ import React, {useCallback, useMemo} from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; import {useOnyx} from 'react-native-onyx'; +import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import Button from '@components/Button'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import MoneyRequestView from '@components/ReportActionItem/MoneyRequestView'; @@ -35,6 +36,8 @@ function Confirmation() { const reportAction = Object.values(reportActions ?? {}).find( (action) => ReportActionsUtils.isMoneyRequestAction(action) && ReportActionsUtils.getOriginalMessage(action)?.IOUTransactionID === reviewDuplicates?.transactionID, ); + const [isLoadingReportData] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA, {initialValue: true}); + const transactionID = ReportActionsUtils.getLinkedTransactionID(reportAction, report?.reportID ?? '-1') ?? '-1'; const transactionsMergeParams = useMemo(() => TransactionUtils.buildTransactionsMergeParams(reviewDuplicates, transaction), [reviewDuplicates, transaction]); const mergeDuplicates = useCallback(() => { @@ -59,34 +62,36 @@ function Confirmation() { testID={Confirmation.displayName} shouldShowOfflineIndicator > - - - - - {translate('violations.confirmDetails')} - - {translate('violations.confirmDuplicatesInfo')} - - {/* We need that provider here becuase MoneyRequestView component require that */} - - } + + + + + + {translate('violations.confirmDetails')} + + {translate('violations.confirmDuplicatesInfo')} + + {/* We need that provider here becuase MoneyRequestView component require that */} + + } + /> + +