Skip to content

Commit

Permalink
Merge pull request #24404 from dukenv0307/fix/23604
Browse files Browse the repository at this point in the history
Update context menu correctly for thread first chat
  • Loading branch information
srikarparsi authored Aug 21, 2023
2 parents 50f20d5 + 450b2f3 commit 298ae29
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ function ReportActionItem(props) {
const textInputRef = useRef();
const popoverAnchorRef = useRef();
const downloadedPreviews = useRef([]);
const originalReportID = ReportUtils.getOriginalReportID(props.report.reportID, props.action);
const originalReport = props.report.reportID === originalReportID ? props.report : ReportUtils.getReport(originalReportID);

useEffect(
() => () => {
Expand Down Expand Up @@ -213,7 +215,6 @@ function ReportActionItem(props) {
}

setIsContextMenuActive(true);

const selection = SelectionScraper.getCurrentSelection();
ReportActionContextMenu.showContextMenu(
ContextMenuActions.CONTEXT_MENU_TYPES.REPORT_ACTION,
Expand All @@ -225,11 +226,11 @@ function ReportActionItem(props) {
props.draftMessage,
() => {},
toggleContextMenuFromActiveReportAction,
ReportUtils.isArchivedRoom(props.report),
ReportUtils.chatIncludesChronos(props.report),
ReportUtils.isArchivedRoom(originalReport),
ReportUtils.chatIncludesChronos(originalReport),
);
},
[props.draftMessage, props.action, props.report, toggleContextMenuFromActiveReportAction],
[props.draftMessage, props.action, props.report.reportID, toggleContextMenuFromActiveReportAction, originalReport],
);

const toggleReaction = useCallback(
Expand Down Expand Up @@ -538,11 +539,11 @@ function ReportActionItem(props) {
<MiniReportActionContextMenu
reportID={props.report.reportID}
reportAction={props.action}
isArchivedRoom={ReportUtils.isArchivedRoom(props.report)}
isArchivedRoom={ReportUtils.isArchivedRoom(originalReport)}
displayAsGroup={props.displayAsGroup}
isVisible={hovered && !props.draftMessage && !hasErrors}
draftMessage={props.draftMessage}
isChronosReport={ReportUtils.chatIncludesChronos(props.report)}
isChronosReport={ReportUtils.chatIncludesChronos(originalReport)}
/>
<View
style={StyleUtils.getReportActionItemStyle(
Expand Down

0 comments on commit 298ae29

Please sign in to comment.