From 2cf75b1bd960c9e75e30cd5132aaa28ba37c9fec Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Tue, 23 Sep 2025 16:36:56 +0300 Subject: [PATCH 1/2] update shouldWaitForTransactions logic --- src/libs/MoneyRequestReportUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/MoneyRequestReportUtils.ts b/src/libs/MoneyRequestReportUtils.ts index 0d920f2fc3d6..87dfde87eba4 100644 --- a/src/libs/MoneyRequestReportUtils.ts +++ b/src/libs/MoneyRequestReportUtils.ts @@ -108,10 +108,10 @@ function shouldDisplayReportTableView(report: OnyxEntry, transactions: T function shouldWaitForTransactions(report: OnyxEntry, transactions: Transaction[] | undefined, reportMetadata: OnyxEntry) { const isTransactionDataReady = transactions !== undefined; const isTransactionThreadView = isReportTransactionThread(report); - const isStillLoadingData = !!reportMetadata?.isLoadingInitialReportActions || !!reportMetadata?.isLoadingOlderReportActions || !!reportMetadata?.isLoadingNewerReportActions; + const isStillLoadingData = transactions?.length === 0 && (!!reportMetadata?.isLoadingInitialReportActions || report?.total !== 0); return ( (isMoneyRequestReport(report) || isInvoiceReport(report)) && - (!isTransactionDataReady || (isStillLoadingData && transactions?.length === 0)) && + (!isTransactionDataReady || isStillLoadingData) && !isTransactionThreadView && report?.pendingFields?.createReport !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD && !reportMetadata?.hasOnceLoadedReportActions From 668634b1b422aa026e0af553f72445d0199b3750 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Tue, 23 Sep 2025 19:53:00 +0300 Subject: [PATCH 2/2] minor update --- src/libs/MoneyRequestReportUtils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/MoneyRequestReportUtils.ts b/src/libs/MoneyRequestReportUtils.ts index 87dfde87eba4..cff7062eb953 100644 --- a/src/libs/MoneyRequestReportUtils.ts +++ b/src/libs/MoneyRequestReportUtils.ts @@ -108,13 +108,12 @@ function shouldDisplayReportTableView(report: OnyxEntry, transactions: T function shouldWaitForTransactions(report: OnyxEntry, transactions: Transaction[] | undefined, reportMetadata: OnyxEntry) { const isTransactionDataReady = transactions !== undefined; const isTransactionThreadView = isReportTransactionThread(report); - const isStillLoadingData = transactions?.length === 0 && (!!reportMetadata?.isLoadingInitialReportActions || report?.total !== 0); + const isStillLoadingData = transactions?.length === 0 && ((!!reportMetadata?.isLoadingInitialReportActions && !reportMetadata.hasOnceLoadedReportActions) || report?.total !== 0); return ( (isMoneyRequestReport(report) || isInvoiceReport(report)) && (!isTransactionDataReady || isStillLoadingData) && !isTransactionThreadView && - report?.pendingFields?.createReport !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD && - !reportMetadata?.hasOnceLoadedReportActions + report?.pendingFields?.createReport !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD ); }