Cancel start DM if there is no more selected user

This commit is contained in:
Florian Renaud 2023-04-05 17:37:09 +02:00
parent 0da8b5a58d
commit 5bb31c1c3b

View file

@ -113,9 +113,10 @@ fun CreateRoomRootView(
content = stringResource(id = StringR.string.screen_start_chat_error_starting_chat),
onDismiss = { state.eventSink(CreateRoomRootEvents.CancelStartDM) },
onRetry = {
state.userListState.selectedUsers.firstOrNull()?.let {
state.eventSink(CreateRoomRootEvents.StartDM(it))
}
state.userListState.selectedUsers.firstOrNull()
?.let { state.eventSink(CreateRoomRootEvents.StartDM(it)) }
// Cancel start DM if there is no more selected user (should not happen)
?: state.eventSink(CreateRoomRootEvents.CancelStartDM)
},
)
}