diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index f4d9c6d28869..2c35502f760e 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -501,7 +501,7 @@ function getOptions(reports, personalDetails, activeReportID, { const shouldFilterReportIfRead = hideReadReports && !ReportUtils.isUnread(report); const shouldFilterReport = shouldFilterReportIfEmpty || shouldFilterReportIfRead; - if (report.reportID.toString() !== activeReportID + if (report.reportID !== activeReportID && (!report.isPinned || isDefaultRoom) && !hasDraftComment && shouldFilterReport diff --git a/src/libs/SidebarUtils.js b/src/libs/SidebarUtils.js index 36ad10cf2ddd..9fa11976ce57 100644 --- a/src/libs/SidebarUtils.js +++ b/src/libs/SidebarUtils.js @@ -136,7 +136,7 @@ function getOrderedReportIDs() { const shouldFilterReportIfRead = hideReadReports && !ReportUtils.isUnread(report); const shouldFilterReport = shouldFilterReportIfEmpty || shouldFilterReportIfRead; - if (report.reportID.toString() !== currentlyViewedReportID + if (report.reportID !== currentlyViewedReportID && !report.isPinned && !hasDraftComment && shouldFilterReport @@ -186,7 +186,7 @@ function getOrderedReportIDs() { // If the active report has a draft, we do not put it in the group of draft reports because we want it to maintain it's current position. Otherwise the report's position // jumps around in the LHN and it's kind of confusing to the user to see the LHN reorder when they start typing a comment on a report. - } else if (report.hasDraft && report.reportID.toString() !== currentlyViewedReportID) { + } else if (report.hasDraft && report.reportID !== currentlyViewedReportID) { draftReportOptions.push(report); } else { recentReportOptions.push(report); @@ -213,10 +213,7 @@ function getOrderedReportIDs() { }); recentReportOptions = sortedPinnedReports.concat(recentReportOptions); - return _.chain(recentReportOptions) - .pluck('reportID') - .map(reportID => reportID.toString()) - .value(); + return _.pluck(recentReportOptions, 'reportID'); } /** diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index c39f6a2df8be..9008c209e53f 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -127,6 +127,7 @@ function getSimplifiedReportObject(report) { ]); return { + // This needs to be cast to a string until the IOU API has been fully migrated to OfflineFirst API reportID: report.reportID.toString(), reportName: report.reportName, chatType, diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 491d7f44fb8b..4977d8cdd04f 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -45,6 +45,7 @@ import toggleReportActionComposeView from '../../../libs/toggleReportActionCompo import OfflineIndicator from '../../../components/OfflineIndicator'; import ExceededCommentLength from '../../../components/ExceededCommentLength'; import withNavigationFocus from '../../../components/withNavigationFocus'; +import reportPropTypes from '../../reportPropTypes'; const propTypes = { /** Beta features list */ @@ -69,11 +70,7 @@ const propTypes = { personalDetails: PropTypes.objectOf(participantPropTypes), /** The report currently being looked at */ - report: PropTypes.shape({ - - /** participants associated with current report */ - participants: PropTypes.arrayOf(PropTypes.string), - }), + report: reportPropTypes, /** Array of report actions for this report */ reportActions: PropTypes.objectOf(PropTypes.shape(reportActionPropTypes)), @@ -387,12 +384,12 @@ class ReportActionCompose extends React.Component { // Indicate that draft has been created. if (this.comment.length === 0 && newComment.length !== 0) { - Report.setReportWithDraft(this.props.reportID.toString(), true); + Report.setReportWithDraft(this.props.reportID, true); } // The draft has been deleted. if (newComment.length === 0) { - Report.setReportWithDraft(this.props.reportID.toString(), false); + Report.setReportWithDraft(this.props.reportID, false); } this.comment = newComment;