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 73e67b638d
commit badea87d7c

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)
},
)
}