From 749e7ba0872d7865d65e71ef17cfad9aff237d47 Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Fri, 1 Apr 2022 11:36:55 -0600 Subject: [PATCH 1/4] Pass param noting that the user manually marked the message as unread --- src/libs/actions/Report.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index c1a21d187f3a..f4a1e3567a0f 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1232,10 +1232,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; @@ -1261,6 +1262,7 @@ function updateLastReadActionID(reportID, sequenceNumber) { API.Report_UpdateLastRead({ reportID, sequenceNumber: lastReadSequenceNumber, + 'markAsUnread': manuallyMarked, }); } From bb6bf67fae51260168a7c4b627a47da7cbbc76c5 Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Fri, 1 Apr 2022 11:38:26 -0600 Subject: [PATCH 2/4] Pass manually marked param from context menu --- src/pages/home/report/ContextMenu/ContextMenuActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js index 34ca78008e41..6395558250e4 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.js +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js @@ -85,7 +85,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); From 4f6744fd7baf907644ae11ffde8887525dbc27b8 Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Fri, 1 Apr 2022 12:49:31 -0600 Subject: [PATCH 3/4] Remove unnecessary quotes --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index f4a1e3567a0f..1b662131c907 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1262,7 +1262,7 @@ function updateLastReadActionID(reportID, sequenceNumber, manuallyMarked = false API.Report_UpdateLastRead({ reportID, sequenceNumber: lastReadSequenceNumber, - 'markAsUnread': manuallyMarked, + markAsUnread: manuallyMarked, }); } From efe4f0c7f1aa36d06d373905371704380003140c Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Thu, 7 Apr 2022 13:58:05 -0600 Subject: [PATCH 4/4] Fix docs --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 9d6239fcaeac..5ef5463a5437 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1254,7 +1254,7 @@ 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 + * @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) */