Skip to content

Commit

Permalink
Merge pull request #58001 from daledah/fix/57977
Browse files Browse the repository at this point in the history
[CP Staging] fix: refactor logics to show copy URL without reportID

(cherry picked from commit 4d66966)

(CP triggered by puneetlath)
  • Loading branch information
MariaHCD authored and OSBotify committed Mar 7, 2025
1 parent c5e2123 commit c6d50fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ function BaseReportActionContextMenu({
let filteredContextMenuActions = ContextMenuActions.filter(
(contextAction) =>
!disabledActions.includes(contextAction) &&
reportID &&
contextAction.shouldShow({
type,
reportAction,
Expand Down
5 changes: 3 additions & 2 deletions src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ type ShouldShow = (args: {
betas: OnyxEntry<Beta[]>;
menuTarget: MutableRefObject<ContextMenuAnchor> | undefined;
isChronosReport: boolean;
reportID: string;
reportID?: string;
isPinnedChat: boolean;
isUnreadChat: boolean;
isThreadReportParentAction: boolean;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 &&
Expand Down

0 comments on commit c6d50fb

Please sign in to comment.