Skip to content

Commit

Permalink
Merge pull request #24221 from hungvu193/fix-22019
Browse files Browse the repository at this point in the history
hide mark ask unread with read message
  • Loading branch information
PauloGasparSv authored Aug 8, 2023
2 parents b812cfe + 98b2610 commit 3a425a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export default [
icon: Expensicons.Mail,
successIcon: Expensicons.Checkmark,
shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID, isPinnedChat, isUnreadChat) =>
type === CONTEXT_MENU_TYPES.REPORT_ACTION || (type === CONTEXT_MENU_TYPES.REPORT && !isUnreadChat),
!isUnreadChat && (type === CONTEXT_MENU_TYPES.REPORT_ACTION || type === CONTEXT_MENU_TYPES.REPORT),
onPress: (closePopover, {reportAction, reportID}) => {
Report.markCommentAsUnread(reportID, reportAction.created);
if (closePopover) {
Expand Down
7 changes: 6 additions & 1 deletion src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ function ReportActionItem(props) {
const textInputRef = useRef();
const popoverAnchorRef = useRef();
const downloadedPreviews = useRef([]);
const isPinnedChat = lodashGet(props, 'report.isPinned', false);

useEffect(
() => () => {
Expand Down Expand Up @@ -218,9 +219,11 @@ function ReportActionItem(props) {
toggleContextMenuFromActiveReportAction,
ReportUtils.isArchivedRoom(props.report),
ReportUtils.chatIncludesChronos(props.report),
isPinnedChat,
props.shouldDisplayNewMarker,
);
},
[props.draftMessage, props.action, props.report, toggleContextMenuFromActiveReportAction],
[props.draftMessage, props.action, props.report, toggleContextMenuFromActiveReportAction, props.shouldDisplayNewMarker, isPinnedChat],
);

const toggleReaction = useCallback(
Expand Down Expand Up @@ -529,6 +532,8 @@ function ReportActionItem(props) {
isVisible={hovered && !props.draftMessage && !hasErrors}
draftMessage={props.draftMessage}
isChronosReport={ReportUtils.chatIncludesChronos(props.report)}
isPinnedChat={isPinnedChat}
isUnreadChat={props.shouldDisplayNewMarker}
/>
<View
style={StyleUtils.getReportActionItemStyle(
Expand Down

0 comments on commit 3a425a1

Please sign in to comment.