Skip to content

Commit 4eb10d6

Browse files
authored
Merge pull request #47243 from margelo/feat/show-last-message-during-loading
feat: show last message while loading others
2 parents 68128f5 + 1580522 commit 4eb10d6

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/pages/home/ReportScreen.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import type * as OnyxTypes from '@src/types/onyx';
5050
import {isEmptyObject} from '@src/types/utils/EmptyObject';
5151
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
5252
import HeaderView from './HeaderView';
53+
import ReportActionsListItemRenderer from './report/ReportActionsListItemRenderer';
5354
import ReportActionsView from './report/ReportActionsView';
5455
import ReportFooter from './report/ReportFooter';
5556
import type {ActionListContextType, ReactionListRef, ScrollPosition} from './ReportScreenContext';
@@ -726,6 +727,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
726727
// After creating the task report then navigating to task detail we don't have any report actions and the last read time is empty so We need to update the initial last read time when opening the task report detail.
727728
Report.readNewestAction(report.reportID);
728729
}, [report]);
730+
const firstReportAction = reportActions[0];
729731

730732
return (
731733
<ActionListContext.Provider value={actionListValue}>
@@ -794,7 +796,28 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
794796
{/* Note: The ReportActionsSkeletonView should be allowed to mount even if the initial report actions are not loaded.
795797
If we prevent rendering the report while they are loading then
796798
we'll unnecessarily unmount the ReportActionsView which will clear the new marker lines initial state. */}
797-
{shouldShowSkeleton && <ReportActionsSkeletonView />}
799+
{shouldShowSkeleton && (
800+
<>
801+
<ReportActionsSkeletonView />
802+
{!!firstReportAction && (
803+
<ReportActionsListItemRenderer
804+
reportAction={firstReportAction}
805+
reportActions={reportActions}
806+
parentReportAction={parentReportAction}
807+
parentReportActionForTransactionThread={undefined}
808+
transactionThreadReport={undefined}
809+
index={0}
810+
report={report}
811+
displayAsGroup={false}
812+
shouldHideThreadDividerLine
813+
shouldDisplayNewMarker={false}
814+
shouldDisplayReplyDivider={false}
815+
isFirstVisibleReportAction
816+
shouldUseThreadDividerLine={false}
817+
/>
818+
)}
819+
</>
820+
)}
798821

799822
{isCurrentReportLoadedFromOnyx ? (
800823
<ReportFooter

0 commit comments

Comments
 (0)