mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Fixes bottom sheet intermittently not having the correct height
This commit is contained in:
parent
ff71e69b0e
commit
0506c9abfd
3 changed files with 19 additions and 18 deletions
|
@ -47,7 +47,7 @@ class NewSpaceSummaryController @Inject constructor(
|
|||
override fun buildModels() {
|
||||
val nonNullViewState = viewState ?: return
|
||||
buildGroupModels(
|
||||
nonNullViewState.asyncSpaces(),
|
||||
nonNullViewState.spaces,
|
||||
nonNullViewState.selectedSpace,
|
||||
nonNullViewState.rootSpacesOrdered,
|
||||
nonNullViewState.homeAggregateCount
|
||||
|
|
|
@ -257,29 +257,29 @@ class SpaceListViewModel @AssistedInject constructor(
|
|||
}
|
||||
|
||||
combine(
|
||||
session.flow()
|
||||
.liveSpaceSummaries(params),
|
||||
session.flow().liveSpaceSummaries(params),
|
||||
session.accountDataService()
|
||||
.getLiveRoomAccountDataEvents(setOf(RoomAccountDataTypes.EVENT_TYPE_SPACE_ORDER))
|
||||
.asFlow()
|
||||
) { spaces, _ ->
|
||||
spaces
|
||||
}.execute { asyncSpaces ->
|
||||
val spaces = asyncSpaces.invoke().orEmpty()
|
||||
val rootSpaces = asyncSpaces.invoke().orEmpty().filter { it.flattenParentIds.isEmpty() }
|
||||
val orders = rootSpaces.associate {
|
||||
it.roomId to session.getRoom(it.roomId)
|
||||
?.roomAccountDataService()
|
||||
?.getAccountDataEvent(RoomAccountDataTypes.EVENT_TYPE_SPACE_ORDER)
|
||||
?.content.toModel<SpaceOrderContent>()
|
||||
?.safeOrder()
|
||||
}
|
||||
copy(
|
||||
asyncSpaces = asyncSpaces,
|
||||
spaces = spaces,
|
||||
rootSpacesOrdered = rootSpaces.sortedWith(TopLevelSpaceComparator(orders)),
|
||||
spaceOrderInfo = orders
|
||||
)
|
||||
}
|
||||
.execute { async ->
|
||||
val rootSpaces = async.invoke().orEmpty().filter { it.flattenParentIds.isEmpty() }
|
||||
val orders = rootSpaces.associate {
|
||||
it.roomId to session.getRoom(it.roomId)
|
||||
?.roomAccountDataService()
|
||||
?.getAccountDataEvent(RoomAccountDataTypes.EVENT_TYPE_SPACE_ORDER)
|
||||
?.content.toModel<SpaceOrderContent>()
|
||||
?.safeOrder()
|
||||
}
|
||||
copy(
|
||||
asyncSpaces = async,
|
||||
rootSpacesOrdered = rootSpaces.sortedWith(TopLevelSpaceComparator(orders)),
|
||||
spaceOrderInfo = orders
|
||||
)
|
||||
}
|
||||
|
||||
// clear local echos on update
|
||||
session.accountDataService()
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.matrix.android.sdk.api.util.MatrixItem
|
|||
data class SpaceListViewState(
|
||||
val myMxItem: Async<MatrixItem.UserItem> = Uninitialized,
|
||||
val asyncSpaces: Async<List<RoomSummary>> = Uninitialized,
|
||||
val spaces: List<RoomSummary> = emptyList(),
|
||||
val selectedSpace: RoomSummary? = null,
|
||||
val rootSpacesOrdered: List<RoomSummary>? = null,
|
||||
val spaceOrderInfo: Map<String, String?>? = null,
|
||||
|
|
Loading…
Reference in a new issue