cleaning, quality

This commit is contained in:
Valere 2021-06-17 17:00:28 +02:00
parent 682e926965
commit 3dc7a6dc34
3 changed files with 7 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 New Vector Ltd
* Copyright 2021 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -64,8 +64,7 @@ class SpaceSummaryController @Inject constructor(
nonNullViewState.selectedGroupingMethod,
nonNullViewState.rootSpacesOrdered,
nonNullViewState.expandedStates,
nonNullViewState.homeAggregateCount,
nonNullViewState.spaceOrderInfo)
nonNullViewState.homeAggregateCount)
if (!nonNullViewState.legacyGroups.isNullOrEmpty()) {
genericFooterItem {
@ -108,8 +107,7 @@ class SpaceSummaryController @Inject constructor(
selected: RoomGroupingMethod,
rootSpaces: List<RoomSummary>?,
expandedStates: Map<String, Boolean>,
homeCount: RoomAggregateNotificationCount,
spaceOrderInfo: Map<String, String?>?) {
homeCount: RoomAggregateNotificationCount) {
val host = this
spaceBetaHeaderItem {
id("beta_header")

View File

@ -159,15 +159,15 @@ class SpacesListViewModel @AssistedInject constructor(@Assisted initialState: Sp
is SpaceListAction.OpenSpaceInvite -> handleSelectSpaceInvite(action)
is SpaceListAction.SelectLegacyGroup -> handleSelectGroup(action)
is SpaceListAction.MoveSpace -> handleMoveSpace(action)
is SpaceListAction.OnEndDragging -> handleEndDragging(action)
is SpaceListAction.OnStartDragging -> handleStartDragging(action)
is SpaceListAction.OnEndDragging -> handleEndDragging()
is SpaceListAction.OnStartDragging -> handleStartDragging()
}
}
// PRIVATE METHODS *****************************************************************************
var preDragExpandedState: Map<String, Boolean>? = null
private fun handleStartDragging(action: SpaceListAction.OnStartDragging) = withState { state ->
private fun handleStartDragging() = withState { state ->
preDragExpandedState = state.expandedStates.toMap()
setState {
copy(
@ -178,7 +178,7 @@ class SpacesListViewModel @AssistedInject constructor(@Assisted initialState: Sp
}
}
private fun handleEndDragging(action: SpaceListAction.OnEndDragging) = withState { state ->
private fun handleEndDragging() {
// restore expanded state
setState {
copy(