diff --git a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js b/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js index f53b61989864..344eff33261f 100644 --- a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js +++ b/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js @@ -41,7 +41,7 @@ const getInitialReportScreenParams = _.once((reports) => { // Fallback to empty if for some reason reportID cannot be derived - prevents the app from crashing const reportID = lodashGet(last, 'reportID', ''); - return {reportID}; + return {reportID: String(reportID)}; }); const MainDrawerNavigator = (props) => { diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 8f2f712e89dc..253e8e39a9ee 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -940,6 +940,13 @@ function addAction(reportID, text, file) { * is last read (meaning that the entire report history has been read) */ function updateLastReadActionID(reportID, sequenceNumber) { + // If we aren't specifying a sequenceNumber and have no maxSequenceNumber for this report then we should not update + // the last read. Most likely, we have just created the report and it has no comments. But we should err on the side + // of caution and do nothing in this case. + if (_.isUndefined(sequenceNumber) && _.isUndefined(reportMaxSequenceNumbers[reportID])) { + return; + } + // Need to subtract 1 from sequenceNumber so that the "New" marker appears in the right spot (the last read // action). If 1 isn't subtracted then the "New" marker appears one row below the action (the first unread action) const lastReadSequenceNumber = (sequenceNumber - 1) || reportMaxSequenceNumbers[reportID]; diff --git a/src/pages/home/sidebar/OptionRow.js b/src/pages/home/sidebar/OptionRow.js index 87954e6c48e3..0802b4ef529b 100644 --- a/src/pages/home/sidebar/OptionRow.js +++ b/src/pages/home/sidebar/OptionRow.js @@ -194,7 +194,7 @@ const OptionRow = ({ {option.hasDraftComment && ( - + )} {option.hasOutstandingIOU && ( @@ -202,7 +202,7 @@ const OptionRow = ({ )} {option.isPinned && ( - + )}