Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update context menu correctly for thread first chat #24404

Merged
merged 7 commits into from
Aug 21, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function ReportActionItem(props) {
const textInputRef = useRef();
const popoverAnchorRef = useRef();
const downloadedPreviews = useRef([]);
const originalReport = ReportUtils.getReport(ReportUtils.getOriginalReportID(props.report.reportID, props.action));
dukenv0307 marked this conversation as resolved.
Show resolved Hide resolved

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

setIsContextMenuActive(true);

const selection = SelectionScraper.getCurrentSelection();
ReportActionContextMenu.showContextMenu(
ContextMenuActions.CONTEXT_MENU_TYPES.REPORT_ACTION,
Expand All @@ -225,11 +225,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, toggleContextMenuFromActiveReportAction, originalReport],
dukenv0307 marked this conversation as resolved.
Show resolved Hide resolved
);

const toggleReaction = useCallback(
Expand Down Expand Up @@ -542,11 +542,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