Restore Breadcrumbs comparator, we can maybe improve this later

This commit is contained in:
Benoit Marty 2020-02-13 23:00:03 +01:00
parent b66b96899e
commit 930d62c87b
1 changed files with 6 additions and 5 deletions

View File

@ -31,12 +31,13 @@ import im.vector.matrix.rx.rx
import im.vector.riotx.core.extensions.exhaustive import im.vector.riotx.core.extensions.exhaustive
import im.vector.riotx.core.platform.VectorViewModel import im.vector.riotx.core.platform.VectorViewModel
import im.vector.riotx.features.attachments.toGroupedContentAttachmentData import im.vector.riotx.features.attachments.toGroupedContentAttachmentData
import im.vector.riotx.features.home.room.list.ChronologicalRoomComparator import im.vector.riotx.features.home.room.list.BreadcrumbsRoomComparator
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class IncomingShareViewModel @AssistedInject constructor(@Assisted initialState: IncomingShareViewState, class IncomingShareViewModel @AssistedInject constructor(
@Assisted initialState: IncomingShareViewState,
private val session: Session, private val session: Session,
private val chronologicalRoomComparator: ChronologicalRoomComparator) private val breadcrumbsRoomComparator: BreadcrumbsRoomComparator)
: VectorViewModel<IncomingShareViewState, IncomingShareAction, IncomingShareViewEvents>(initialState) { : VectorViewModel<IncomingShareViewState, IncomingShareAction, IncomingShareViewEvents>(initialState) {
@AssistedInject.Factory @AssistedInject.Factory
@ -83,7 +84,7 @@ class IncomingShareViewModel @AssistedInject constructor(@Assisted initialState:
session.rx().liveRoomSummaries(filterQueryParams) session.rx().liveRoomSummaries(filterQueryParams)
} }
.throttleLast(300, TimeUnit.MILLISECONDS) .throttleLast(300, TimeUnit.MILLISECONDS)
.map { it.sortedWith(chronologicalRoomComparator) } .map { it.sortedWith(breadcrumbsRoomComparator) }
.execute { .execute {
copy(filteredRoomSummaries = it) copy(filteredRoomSummaries = it)
} }