Join Room : fallback to show Join button when RoomContent is Unknown (preview fails)
This commit is contained in:
parent
85d6acfc48
commit
d162c8ffab
1 changed files with 4 additions and 0 deletions
|
|
@ -37,7 +37,11 @@ data class JoinRoomState(
|
||||||
val eventSink: (JoinRoomEvents) -> Unit
|
val eventSink: (JoinRoomEvents) -> Unit
|
||||||
) {
|
) {
|
||||||
val joinAuthorisationStatus = when (contentState) {
|
val joinAuthorisationStatus = when (contentState) {
|
||||||
|
// Use the join authorisation status from the loaded content state
|
||||||
is ContentState.Loaded -> contentState.joinAuthorisationStatus
|
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
|
else -> JoinAuthorisationStatus.Unknown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue