@@ -26,7 +26,6 @@ import {
2626 chatIncludesChronosWithID ,
2727 getSourceIDFromReportAction ,
2828 isArchivedNonExpenseReport ,
29- isArchivedNonExpenseReportWithID ,
3029 isInvoiceReport as ReportUtilsIsInvoiceReport ,
3130 isMoneyRequest as ReportUtilsIsMoneyRequest ,
3231 isMoneyRequestReport as ReportUtilsIsMoneyRequestReport ,
@@ -190,9 +189,8 @@ function BaseReportActionContextMenu({
190189 } , [ parentReportAction , isMoneyRequestReport , isInvoiceReport , paginatedReportActions , transactionThreadReport ?. parentReportActionID ] ) ;
191190
192191 const moneyRequestAction = transactionThreadReportID ? requestParentReportAction : parentReportAction ;
193-
194- const [ childReportNameValuePairs ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_NAME_VALUE_PAIRS } ${ childReport ?. reportID } ` , { canBeMissing : true } ) ;
195- const [ parentReportNameValuePairs ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_NAME_VALUE_PAIRS } ${ childReport ?. parentReportID } ` , { canBeMissing : true } ) ;
192+ const isChildReportArchived = useReportIsArchived ( childReport ?. reportID ) ;
193+ const isParentReportArchived = useReportIsArchived ( childReport ?. parentReportID ) ;
196194 const [ parentReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ childReport ?. parentReportID } ` , { canBeMissing : true } ) ;
197195
198196 const isMoneyRequest = useMemo ( ( ) => ReportUtilsIsMoneyRequest ( childReport ) , [ childReport ] ) ;
@@ -203,10 +201,7 @@ function BaseReportActionContextMenu({
203201 const areHoldRequirementsMet =
204202 ! isInvoiceReport &&
205203 isMoneyRequestOrReport &&
206- ! isArchivedNonExpenseReport (
207- transactionThreadReportID ? childReport : parentReport ,
208- transactionThreadReportID ? ! ! childReportNameValuePairs ?. private_isArchived : ! ! parentReportNameValuePairs ?. private_isArchived ,
209- ) ;
204+ ! isArchivedNonExpenseReport ( transactionThreadReportID ? childReport : parentReport , transactionThreadReportID ? isChildReportArchived : isParentReportArchived ) ;
210205
211206 const shouldEnableArrowNavigation = ! isMini && ( isVisible || shouldKeepOpen ) ;
212207 let filteredContextMenuActions = ContextMenuActions . filter (
@@ -300,7 +295,7 @@ function BaseReportActionContextMenu({
300295 report : {
301296 reportID,
302297 originalReportID,
303- isArchivedRoom : isArchivedNonExpenseReportWithID ( originalReport , isOriginalReportArchived ) ,
298+ isArchivedRoom : isArchivedNonExpenseReport ( originalReport , isOriginalReportArchived ) ,
304299 isChronos : chatIncludesChronosWithID ( originalReportID ) ,
305300 } ,
306301 reportAction : {
0 commit comments