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), content = stringResource(id = StringR.string.screen_start_chat_error_starting_chat),
onDismiss = { state.eventSink(CreateRoomRootEvents.CancelStartDM) }, onDismiss = { state.eventSink(CreateRoomRootEvents.CancelStartDM) },
onRetry = { onRetry = {
state.userListState.selectedUsers.firstOrNull()?.let { state.userListState.selectedUsers.firstOrNull()
state.eventSink(CreateRoomRootEvents.StartDM(it)) ?.let { state.eventSink(CreateRoomRootEvents.StartDM(it)) }
} // Cancel start DM if there is no more selected user (should not happen)
?: state.eventSink(CreateRoomRootEvents.CancelStartDM)
}, },
) )
} }