Add suggestions section to InvitePeopleView

This commit is contained in:
ganfra
2026-01-19 17:35:39 +01:00
parent 23d3066a38
commit 7be66061e2
11 changed files with 227 additions and 48 deletions

View File

@@ -31,6 +31,10 @@ import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.take
import kotlinx.coroutines.flow.toList
private const val MAX_SUGGESTIONS_COUNT = 5
@AssistedInject
class DefaultUserListPresenter(
@@ -53,7 +57,10 @@ class DefaultUserListPresenter(
override fun present(): UserListState {
var recentDirectRooms by remember { mutableStateOf(emptyList<RecentDirectRoom>()) }
LaunchedEffect(Unit) {
recentDirectRooms = matrixClient.getRecentDirectRooms()
recentDirectRooms = matrixClient
.getRecentDirectRooms()
.take(MAX_SUGGESTIONS_COUNT)
.toList()
}
var isSearchActive by rememberSaveable { mutableStateOf(false) }
val selectedUsers by userListDataStore.selectedUsers.collectAsState(emptyList())