Skip to content

Commit

Permalink
Revert "Fix message highlight stuck when open the 2nd context menu"
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins authored Aug 20, 2024
1 parent c6d81c8 commit b73603a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef<Repor
reportIDRef.current = '-1';
reportActionIDRef.current = '-1';
originalReportIDRef.current = '-1';
setInstanceID('');

onPopoverHide.current = runAndResetCallback(onPopoverHide.current);
onPopoverHideActionCallback.current = runAndResetCallback(onPopoverHideActionCallback.current);
Expand Down
48 changes: 22 additions & 26 deletions src/pages/home/report/ContextMenu/ReportActionContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,37 +123,33 @@ function showContextMenu(
if (!contextMenuRef.current) {
return;
}
const show = () => {
contextMenuRef.current?.showContextMenu(
type,
event,
selection,
contextMenuAnchor,
reportID,
reportActionID,
originalReportID,
draftMessage,
onShow,
onHide,
isArchivedRoom,
isChronosReport,
isPinnedChat,
isUnreadChat,
disabledActions,
shouldCloseOnTarget,
setIsEmojiPickerActive,
isOverflowMenu,
);
};

// If there is an already open context menu, close it first before opening
// a new one.
if (contextMenuRef.current.instanceID) {
hideContextMenu(false, show);
return;
hideContextMenu();
contextMenuRef.current.runAndResetOnPopoverHide();
}

show();
contextMenuRef.current.showContextMenu(
type,
event,
selection,
contextMenuAnchor,
reportID,
reportActionID,
originalReportID,
draftMessage,
onShow,
onHide,
isArchivedRoom,
isChronosReport,
isPinnedChat,
isUnreadChat,
disabledActions,
shouldCloseOnTarget,
setIsEmojiPickerActive,
isOverflowMenu,
);
}

/**
Expand Down

0 comments on commit b73603a

Please sign in to comment.