mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Fixes #4534 - Use content_loaded instead of io.element.join for detecting EC timeouts. Bump EC to 0.16.0-rc.4.
This commit is contained in:
committed by
Stefan Ceriu
parent
29bddee91a
commit
3f0df6eccf
@@ -106,7 +106,7 @@ enum CallScreenJavaScriptMessageName: String, CaseIterable {
|
||||
|
||||
struct DecodedWidgetMessage: Decodable {
|
||||
private static let decoder = JSONDecoder()
|
||||
private static let joinAction = "io.element.join"
|
||||
private static let contentLoadedAction = "content_loaded"
|
||||
private static let fromWidget = "fromWidget"
|
||||
|
||||
let action: String?
|
||||
@@ -119,7 +119,7 @@ struct DecodedWidgetMessage: Decodable {
|
||||
return try decoder.decode(DecodedWidgetMessage.self, from: data)
|
||||
}
|
||||
|
||||
var hasJoined: Bool {
|
||||
action == Self.joinAction && api == Self.fromWidget
|
||||
var hasLoaded: Bool {
|
||||
action == Self.contentLoadedAction && api == Self.fromWidget
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
|
||||
private func handleWidgetAction(message: String) async {
|
||||
if timeoutTask != nil,
|
||||
let decodedMessage = try? DecodedWidgetMessage.decode(message: message),
|
||||
decodedMessage.hasJoined {
|
||||
decodedMessage.hasLoaded {
|
||||
// This means that the call room was joined succesfully, we can stop the timeout task
|
||||
timeoutTask = nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user