Skip to content
Draft
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
7 changes: 7 additions & 0 deletions src/pages/TransactionMerge/ConfirmationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Text from '@components/Text';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import useMergeTransactions from '@hooks/useMergeTransactions';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import useSelfDMReport from '@hooks/useSelfDMReport';
Expand All @@ -39,6 +40,7 @@ function ConfirmationPage({route}: ConfirmationPageProps) {
const [isMergingExpenses, setIsMergingExpenses] = useState(false);

const {transactionID, isOnSearch, backTo} = route.params;
const {isOffline} = useNetwork();

const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: false});
const [mergeTransaction, mergeTransactionMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.MERGE_TRANSACTION}${getNonEmptyStringOnyxID(transactionID)}`, {canBeMissing: true});
Expand Down Expand Up @@ -96,6 +98,11 @@ function ConfirmationPage({route}: ConfirmationPageProps) {

const reportIDToDismiss = reportID !== CONST.REPORT.UNREPORTED_REPORT_ID ? reportID : undefined;

if (isOffline) {
Navigation.dismissToSuperWideRHP();
Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.dismissModal());
return;
}
// If we're on search, dismiss the modal and stay on search
if (!isOnSearch && reportIDToDismiss && reportID !== targetTransaction.reportID) {
// Navigate to search money report screen if we're on Reports
Expand Down
Loading