Fixes bottom sheet intermittently not having the correct height
This commit is contained in:
parent
ff71e69b0e
commit
0506c9abfd
@ -47,7 +47,7 @@ class NewSpaceSummaryController @Inject constructor(
|
|||||||
override fun buildModels() {
|
override fun buildModels() {
|
||||||
val nonNullViewState = viewState ?: return
|
val nonNullViewState = viewState ?: return
|
||||||
buildGroupModels(
|
buildGroupModels(
|
||||||
nonNullViewState.asyncSpaces(),
|
nonNullViewState.spaces,
|
||||||
nonNullViewState.selectedSpace,
|
nonNullViewState.selectedSpace,
|
||||||
nonNullViewState.rootSpacesOrdered,
|
nonNullViewState.rootSpacesOrdered,
|
||||||
nonNullViewState.homeAggregateCount
|
nonNullViewState.homeAggregateCount
|
||||||
|
@ -257,16 +257,15 @@ class SpaceListViewModel @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
combine(
|
combine(
|
||||||
session.flow()
|
session.flow().liveSpaceSummaries(params),
|
||||||
.liveSpaceSummaries(params),
|
|
||||||
session.accountDataService()
|
session.accountDataService()
|
||||||
.getLiveRoomAccountDataEvents(setOf(RoomAccountDataTypes.EVENT_TYPE_SPACE_ORDER))
|
.getLiveRoomAccountDataEvents(setOf(RoomAccountDataTypes.EVENT_TYPE_SPACE_ORDER))
|
||||||
.asFlow()
|
.asFlow()
|
||||||
) { spaces, _ ->
|
) { spaces, _ ->
|
||||||
spaces
|
spaces
|
||||||
}
|
}.execute { asyncSpaces ->
|
||||||
.execute { async ->
|
val spaces = asyncSpaces.invoke().orEmpty()
|
||||||
val rootSpaces = async.invoke().orEmpty().filter { it.flattenParentIds.isEmpty() }
|
val rootSpaces = asyncSpaces.invoke().orEmpty().filter { it.flattenParentIds.isEmpty() }
|
||||||
val orders = rootSpaces.associate {
|
val orders = rootSpaces.associate {
|
||||||
it.roomId to session.getRoom(it.roomId)
|
it.roomId to session.getRoom(it.roomId)
|
||||||
?.roomAccountDataService()
|
?.roomAccountDataService()
|
||||||
@ -275,7 +274,8 @@ class SpaceListViewModel @AssistedInject constructor(
|
|||||||
?.safeOrder()
|
?.safeOrder()
|
||||||
}
|
}
|
||||||
copy(
|
copy(
|
||||||
asyncSpaces = async,
|
asyncSpaces = asyncSpaces,
|
||||||
|
spaces = spaces,
|
||||||
rootSpacesOrdered = rootSpaces.sortedWith(TopLevelSpaceComparator(orders)),
|
rootSpacesOrdered = rootSpaces.sortedWith(TopLevelSpaceComparator(orders)),
|
||||||
spaceOrderInfo = orders
|
spaceOrderInfo = orders
|
||||||
)
|
)
|
||||||
|
@ -26,6 +26,7 @@ import org.matrix.android.sdk.api.util.MatrixItem
|
|||||||
data class SpaceListViewState(
|
data class SpaceListViewState(
|
||||||
val myMxItem: Async<MatrixItem.UserItem> = Uninitialized,
|
val myMxItem: Async<MatrixItem.UserItem> = Uninitialized,
|
||||||
val asyncSpaces: Async<List<RoomSummary>> = Uninitialized,
|
val asyncSpaces: Async<List<RoomSummary>> = Uninitialized,
|
||||||
|
val spaces: List<RoomSummary> = emptyList(),
|
||||||
val selectedSpace: RoomSummary? = null,
|
val selectedSpace: RoomSummary? = null,
|
||||||
val rootSpacesOrdered: List<RoomSummary>? = null,
|
val rootSpacesOrdered: List<RoomSummary>? = null,
|
||||||
val spaceOrderInfo: Map<String, String?>? = null,
|
val spaceOrderInfo: Map<String, String?>? = null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user