@@ -72,14 +72,14 @@ import type * as OnyxTypes from '@src/types/onyx';
7272import FloatingMessageCounter from './FloatingMessageCounter' ;
7373import getInitialNumToRender from './getInitialNumReportActionsToRender' ;
7474import getReportActionsListInitialNumToRender from './getReportActionsListInitialNumToRender' ;
75- import { useReportActionActiveEdit } from './ReportActionEditMessageContext' ;
7675import ReportActionsListHeader from './ReportActionsListHeader' ;
7776import ReportActionsListItemRenderer from './ReportActionsListItemRenderer' ;
7877import { getUnreadMarkerReportAction } from './shouldDisplayNewMarkerOnReportAction' ;
7978import ShowPreviousMessagesButton from './ShowPreviousMessagesButton' ;
8079import StaticReportActionsPreview from './StaticReportActionsPreview' ;
8180import useReportActionsNewActionLiveTail from './useReportActionsNewActionLiveTail' ;
8281import useReportUnreadMessageScrollTracking from './useReportUnreadMessageScrollTracking' ;
82+ import useShouldShowComposerForActiveEditDraft from './useShouldShowComposerForActiveEditDraft' ;
8383
8484type ReportActionsListProps = {
8585 /** The report currently being looked at */
@@ -842,8 +842,7 @@ function ReportActionsList({
842842 ( ) => [ shouldUseNarrowLayout ? unreadMarkerReportActionID : undefined , isArchivedNonExpenseReport ( report , isReportArchived ) , draftReportAction ?. reportActionID , draftMessageHTML ] ,
843843 [ draftMessageHTML , draftReportAction ?. reportActionID , unreadMarkerReportActionID , shouldUseNarrowLayout , report , isReportArchived ] ,
844844 ) ;
845- const { editingReportActionID} = useReportActionActiveEdit ( ) ;
846- const shouldShowComposerForActiveEditDraft = shouldUseNarrowLayout && editingReportActionID !== null ;
845+ const shouldShowComposerForActiveEditDraft = useShouldShowComposerForActiveEditDraft ( ) ;
847846 const hideComposer = ! canUserPerformWriteAction ( report , isReportArchived ) && ! shouldShowComposerForActiveEditDraft ;
848847 const shouldShowReportRecipientLocalTime = canShowReportRecipientLocalTime ( personalDetailsList , report , currentUserAccountID ) && ! isComposerFullSize ;
849848 const canShowHeader = isOffline || hasHeaderRendered . current ;
0 commit comments