From e4681b8a4a59a4543cce8ded7c476960fda297fb Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 24 Oct 2024 12:02:20 +0800 Subject: [PATCH] fix copy to clipboard error because action is undefined --- .../home/report/ContextMenu/BaseReportActionContextMenu.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx index 40ace38a9784..2e92669aa8c5 100755 --- a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx +++ b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx @@ -105,6 +105,7 @@ function BaseReportActionContextMenu({ draftMessage = '', reportActionID, reportID, + originalReportID, checkIfContextMenuActive, disabledActions = [], setIsEmojiPickerActive, @@ -120,7 +121,7 @@ function BaseReportActionContextMenu({ const {isProduction} = useEnvironment(); const threedotRef = useRef(null); const [betas] = useOnyx(ONYXKEYS.BETAS); - const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, { + const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${originalReportID}`, { canEvict: false, }); const transactionID = ReportActionsUtils.getLinkedTransactionID(reportActionID, reportID); @@ -179,8 +180,6 @@ function BaseReportActionContextMenu({ const areHoldRequirementsMet = !isInvoiceReport && isMoneyRequestOrReport && !ReportUtils.isArchivedRoom(transactionThreadReportID ? childReport : parentReport, parentReportNameValuePairs); - const originalReportID = useMemo(() => ReportUtils.getOriginalReportID(reportID, reportAction), [reportID, reportAction]); - const shouldEnableArrowNavigation = !isMini && (isVisible || shouldKeepOpen); let filteredContextMenuActions = ContextMenuActions.filter( (contextAction) =>