mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:06:00 +00:00
Stop showing "Preview unavailable" while loading room preview details on the JoinRoomScreen
This commit is contained in:
committed by
Stefan Ceriu
parent
cefa38049f
commit
63a474bb3f
@@ -22,6 +22,7 @@ enum JoinRoomScreenViewModelAction {
|
||||
}
|
||||
|
||||
enum JoinRoomScreenInteractionMode {
|
||||
case loading
|
||||
case unknown
|
||||
case invited
|
||||
case join
|
||||
@@ -34,32 +35,9 @@ struct JoinRoomScreenViewState: BindableState {
|
||||
|
||||
var roomDetails: RoomPreviewDetails?
|
||||
|
||||
var mode: JoinRoomScreenInteractionMode {
|
||||
guard let roomDetails else {
|
||||
return .unknown
|
||||
}
|
||||
|
||||
if roomDetails.isInvited {
|
||||
return .invited
|
||||
}
|
||||
|
||||
if roomDetails.isPublic {
|
||||
return .join
|
||||
}
|
||||
|
||||
// Knocking is not supported yet, treat it as .unknown
|
||||
// if roomDetails.canKnock {
|
||||
// return .knock
|
||||
// }
|
||||
|
||||
return .unknown
|
||||
}
|
||||
var mode: JoinRoomScreenInteractionMode = .loading
|
||||
|
||||
var bindings = JoinRoomScreenViewStateBindings()
|
||||
|
||||
var title: String {
|
||||
roomDetails?.name ?? L10n.screenJoinRoomTitleNoPreview
|
||||
}
|
||||
}
|
||||
|
||||
struct JoinRoomScreenViewStateBindings {
|
||||
|
||||
Reference in New Issue
Block a user