diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d98f62c4aa21..5ef5463a5437 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1254,10 +1254,11 @@ function deleteReportComment(reportID, reportAction) { * * @param {Number} reportID * @param {Number} [sequenceNumber] This can be used to set the last read actionID to a specific + * @param {Boolean} [manuallyMarked] If the user manually marked this as unread, we need to tell the API * spot (eg. mark-as-unread). Otherwise, when this param is omitted, the highest sequence number becomes the one that * is last read (meaning that the entire report history has been read) */ -function updateLastReadActionID(reportID, sequenceNumber) { +function updateLastReadActionID(reportID, sequenceNumber, manuallyMarked = false) { // If report data is loading, we can't update the last read sequence number because it is obsolete if (isReportDataLoading) { return; @@ -1283,6 +1284,7 @@ function updateLastReadActionID(reportID, sequenceNumber) { API.Report_UpdateLastRead({ reportID, sequenceNumber: lastReadSequenceNumber, + markAsUnread: manuallyMarked, }); } diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js index 6306cc67f4b5..b61ebe62f150 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.js +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js @@ -97,7 +97,7 @@ export default [ successIcon: Expensicons.Checkmark, shouldShow: type => type === CONTEXT_MENU_TYPES.REPORT_ACTION, onPress: (closePopover, {reportAction, reportID}) => { - Report.updateLastReadActionID(reportID, reportAction.sequenceNumber); + Report.updateLastReadActionID(reportID, reportAction.sequenceNumber, true); Report.setNewMarkerPosition(reportID, reportAction.sequenceNumber); if (closePopover) { hideContextMenu(true, ReportActionComposeFocusManager.focus);