fix: Make Client.findDM return a Result (#4816)

This commit is contained in:
Jorge Martin Espinosa 2025-06-04 10:41:26 +02:00 committed by GitHub
parent fa2ac28166
commit 07af7cc643
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 44 additions and 22 deletions

View file

@ -55,7 +55,7 @@ class UserProfilePresenter @AssistedInject constructor(
@Composable
private fun getDmRoomId(): State<RoomId?> {
return produceState<RoomId?>(initialValue = null) {
value = client.findDM(userId)
value = client.findDM(userId).getOrNull()
}
}

View file

@ -141,7 +141,7 @@ class UserProfilePresenterTest {
if (canFindRoom) {
givenGetRoomResult(A_ROOM_ID, room)
}
givenFindDmResult(dmRoom)
givenFindDmResult(Result.success(dmRoom))
}
val presenter = createUserProfilePresenter(
userId = A_USER_ID_2,