Join Room : fallback to show Join button when RoomContent is Unknown (preview fails)

This commit is contained in:
ganfra 2024-07-24 10:33:06 +02:00
parent aebcc52309
commit 0dd8303467

View file

@ -37,7 +37,11 @@ data class JoinRoomState(
val eventSink: (JoinRoomEvents) -> Unit
) {
val joinAuthorisationStatus = when (contentState) {
// Use the join authorisation status from the loaded content state
is ContentState.Loaded -> contentState.joinAuthorisationStatus
// Assume that if the room is unknown, the user can join it
is ContentState.UnknownRoom -> JoinAuthorisationStatus.CanJoin
// Otherwise assume that the user can't join the room
else -> JoinAuthorisationStatus.Unknown
}
}