diff --git a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx index 0aead849c16f..a7f4a0202760 100755 --- a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx +++ b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx @@ -205,7 +205,6 @@ function BaseReportActionContextMenu({ let filteredContextMenuActions = ContextMenuActions.filter( (contextAction) => !disabledActions.includes(contextAction) && - reportID && contextAction.shouldShow({ type, reportAction, diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index fb45f60fb3c0..5cffa0fdbb1f 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -150,7 +150,7 @@ type ShouldShow = (args: { betas: OnyxEntry; menuTarget: MutableRefObject | undefined; isChronosReport: boolean; - reportID: string; + reportID?: string; isPinnedChat: boolean; isUnreadChat: boolean; isThreadReportParentAction: boolean; @@ -269,7 +269,7 @@ const ContextMenuActions: ContextMenuAction[] = [ textTranslateKey: 'reportActionContextMenu.replyInThread', icon: Expensicons.ChatBubbleReply, shouldShow: ({type, reportAction, reportID, isThreadReportParentAction}) => { - if (type !== CONST.CONTEXT_MENU_TYPES.REPORT_ACTION) { + if (type !== CONST.CONTEXT_MENU_TYPES.REPORT_ACTION || !reportID) { return false; } return !shouldDisableThread(reportAction, reportID, isThreadReportParentAction); @@ -755,6 +755,7 @@ const ContextMenuActions: ContextMenuAction[] = [ icon: Expensicons.Trashcan, shouldShow: ({type, reportAction, isArchivedRoom, isChronosReport, reportID, moneyRequestAction}) => // Until deleting parent threads is supported in FE, we will prevent the user from deleting a thread parent + !!reportID && type === CONST.CONTEXT_MENU_TYPES.REPORT_ACTION && canDeleteReportAction(moneyRequestAction ?? reportAction, reportID) && !isArchivedRoom &&