Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Comment thread
stitesExpensify marked this conversation as resolved.
// If report data is loading, we can't update the last read sequence number because it is obsolete
if (isReportDataLoading) {
return;
Expand All @@ -1283,6 +1284,7 @@ function updateLastReadActionID(reportID, sequenceNumber) {
API.Report_UpdateLastRead({
reportID,
sequenceNumber: lastReadSequenceNumber,
markAsUnread: manuallyMarked,
Comment thread
stitesExpensify marked this conversation as resolved.
});
}

Expand Down
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 @@ -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);
Expand Down