Skip to content
Merged
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
11 changes: 10 additions & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ function getReportParticipantsTitle(logins) {
return _.map(logins, login => Str.removeSMSDomain(login)).join(', ');
}

/**
* Attempts to find a report in onyx with the provided list of participants
* @param {Object} report
* @returns {Boolean}
*/
function isIOUReport(report) {
return report && _.has(report, 'total');
}

/**
* Check whether a report action is Attachment or not.
* Ignore messages containing [Attachment] as the main content. Attachments are actions with only text as [Attachment].
Expand All @@ -95,7 +104,7 @@ function isReportMessageAttachment({text, html}) {
function sortReportsByLastVisited(reports) {
return _.chain(reports)
.toArray()
.filter(report => report && report.reportID)
.filter(report => report && report.reportID && !isIOUReport(report))
.sortBy('lastVisitedTimestamp')
.value();
}
Expand Down