Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import {isConsecutiveChronosAutomaticTimerAction} from '@libs/ChronosUtils';
import DateUtils from '@libs/DateUtils';
import {hasDeferredWriteForReport} from '@libs/deferredLayoutWrite';
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import {getAllNonDeletedTransactions, isActionVisibleOnMoneyRequestReport} from '@libs/MoneyRequestReportUtils';
import Navigation from '@libs/Navigation/Navigation';
Expand Down Expand Up @@ -654,14 +653,7 @@ function MoneyRequestReportActionsList({onLayout}: MoneyRequestReportListProps)
}, [styles.chatItem.paddingBottom, styles.chatItem.paddingTop, windowHeight, linkedReportActionID]);

const isReportEmpty = isEmpty(visibleReportActions) && isEmpty(transactions) && !showReportActionsLoadingState;
// hasDeferredWriteForReport is non-reactive (reads a module-level Map, not tracked by React).
// This is intentional: we only check on the initial render after the RHP dismisses.
// Once the deferred write flushes and createTransaction runs, Onyx updates make
// transactions non-empty, which drives the transition away from the skeleton.
// Scoping to `report.reportID` ensures an unrelated submit flow's pending dismiss doesn't keep
// *this* report stuck on the skeleton.
const isAwaitingDeferredTransaction = isReportEmpty && hasDeferredWriteForReport(CONST.DEFERRED_LAYOUT_WRITE_KEYS.DISMISS_MODAL, report?.reportID);
const showEmptyState = isReportEmpty && !isAwaitingDeferredTransaction;
const showEmptyState = isReportEmpty;
Comment thread
jakubstec marked this conversation as resolved.

if (!report) {
return null;
Expand All @@ -683,11 +675,9 @@ function MoneyRequestReportActionsList({onLayout}: MoneyRequestReportListProps)
isActive={isFloatingMessageCounterVisible}
onClick={scrollToBottomAndMarkReportAsRead}
/>
{/* Exactly one of these three branches is active at a time:
1. isAwaitingDeferredTransaction — skeleton while dismiss-first creates the transaction
2. showEmptyState — genuinely empty report
3. !isReportEmpty — report has data, render the FlatList */}
{isAwaitingDeferredTransaction && <ReportActionsListLoadingSkeleton reasonAttributes={skeletonReasonAttributes} />}
{/* Exactly one of these two branches is active at a time:
1. showEmptyState — genuinely empty report
2. !isReportEmpty — report has data, render the FlatList */}
{showEmptyState && (
<ScrollView contentContainerStyle={styles.flexGrow1}>
<MoneyRequestViewReportFields
Expand Down
Loading