Skip to content

Commit 9a1167d

Browse files
committed
add explanatory comments
1 parent eacb284 commit 9a1167d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ function MoneyRequestReportPreviewContent({
117117
chatReportMetadata,
118118
}: MoneyRequestReportPreviewContentProps) {
119119
const shouldShowLoading = !chatReportMetadata?.hasOnceLoadedReportActions && transactions.length === 0;
120+
// hasOnceLoadedReportActions is set as true one render before transactions are hydrated, to avoid showing empty state we need to defer loading state, so that it waits one more render for transactions
120121
const shouldShowLoadingDeferred = useDeferredValue(shouldShowLoading);
121122
const lastTransaction = transactions?.at(0);
122123
const shouldShowEmptyPlaceholder = transactions.length === 0;

0 commit comments

Comments
 (0)