Prevent meetings list display issue if source isn't sorted

This commit is contained in:
Sylvain Berfini 2025-03-31 13:31:19 +02:00
parent 9e5a7a2f93
commit 87e64257f5

View file

@ -180,13 +180,17 @@ class MeetingsListViewModel
fetchInProgress.postValue(true)
}
val sortedSource = source.toList().sortedBy {
it.dateTime
}
val list = arrayListOf<MeetingListItemModel>()
var previousModel: MeetingModel? = null
var previousModelWeekLabel = ""
var meetingForTodayFound = false
Log.d("$TAG There are [${source.size}] conference info in DB")
Log.d("$TAG There are [${sortedSource.size}] conference info in DB")
for (info: ConferenceInfo in source) {
for (info: ConferenceInfo in sortedSource) {
if (info.duration == 0) {
Log.d(
"$TAG Skipping conference info [${info.subject}] with uri [${info.uri?.asStringUriOnly()}] because it has no duration"