mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Join Room : fallback to show Join button when RoomContent is Unknown (preview fails)
This commit is contained in:
+4
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user