mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +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
@@ -74,6 +74,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo
|
||||
showLoadingIndicator()
|
||||
|
||||
defer {
|
||||
updateMode()
|
||||
hideLoadingIndicator()
|
||||
}
|
||||
|
||||
@@ -85,6 +86,23 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo
|
||||
}
|
||||
}
|
||||
|
||||
private func updateMode() {
|
||||
guard let roomDetails = state.roomDetails else {
|
||||
state.mode = .unknown
|
||||
return
|
||||
}
|
||||
|
||||
if roomDetails.isPublic {
|
||||
state.mode = .join
|
||||
} else if roomDetails.isInvited {
|
||||
state.mode = .invited
|
||||
} else if roomDetails.canKnock { // Knocking is not supported yet, treat it as .unknown
|
||||
state.mode = .unknown
|
||||
} else {
|
||||
state.mode = .unknown
|
||||
}
|
||||
}
|
||||
|
||||
private func joinRoom() async {
|
||||
showLoadingIndicator()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user