Skip to content

Commit 70b5b5a

Browse files
cristipavalOSBotify
authored andcommitted
Merge pull request #71027 from Expensify/revert-69090-fix-brief-appearance-of-no-expense-empty-view
[CP Staging] Revert "Fix - "This report has no expenses" briefly shown in Reports after clearing cache" (cherry picked from commit 78d8869) (cherry-picked to staging by roryabraham)
1 parent 681485a commit 70b5b5a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libs/MoneyRequestReportUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ function shouldDisplayReportTableView(report: OnyxEntry<Report>, transactions: T
108108
function shouldWaitForTransactions(report: OnyxEntry<Report>, transactions: Transaction[] | undefined, reportMetadata: OnyxEntry<ReportMetadata>) {
109109
const isTransactionDataReady = transactions !== undefined;
110110
const isTransactionThreadView = isReportTransactionThread(report);
111-
const isStillLoadingData = transactions?.length === 0 && (!!reportMetadata?.isLoadingInitialReportActions || report?.total !== 0);
112-
111+
const isStillLoadingData = !!reportMetadata?.isLoadingInitialReportActions || !!reportMetadata?.isLoadingOlderReportActions || !!reportMetadata?.isLoadingNewerReportActions;
113112
return (
114113
(isMoneyRequestReport(report) || isInvoiceReport(report)) &&
115-
(!isTransactionDataReady || isStillLoadingData) &&
114+
(!isTransactionDataReady || (isStillLoadingData && transactions?.length === 0)) &&
116115
!isTransactionThreadView &&
117-
report?.pendingFields?.createReport !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD
116+
report?.pendingFields?.createReport !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD &&
117+
!reportMetadata?.hasOnceLoadedReportActions
118118
);
119119
}
120120

0 commit comments

Comments
 (0)