mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fixes #2878 - Retain cycles on the ElementCall webView and correctly tear down the call on dismissal.
This commit is contained in:
committed by
Stefan Ceriu
parent
8bfd802793
commit
f8d094516d
@@ -31,10 +31,6 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
deinit {
|
||||
elementCallService.tearDownCallSession()
|
||||
}
|
||||
|
||||
/// Designated initialiser
|
||||
/// - Parameters:
|
||||
/// - elementCallService: service responsible for setting up CallKit
|
||||
@@ -120,7 +116,28 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
|
||||
}
|
||||
}
|
||||
|
||||
func stop() {
|
||||
Task {
|
||||
await hangUp()
|
||||
}
|
||||
|
||||
elementCallService.tearDownCallSession()
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func hangUp() async {
|
||||
let hangUpMessage = """
|
||||
"api":"toWidget",
|
||||
"widgetId":"\(widgetDriver.widgetID)",
|
||||
"requestId":"widgetapi-\(UUID())",
|
||||
"action":"im.vector.hangup",
|
||||
"data":{}
|
||||
"""
|
||||
|
||||
let result = await widgetDriver.sendMessage(hangUpMessage)
|
||||
MXLog.error("Result yo: \(result)")
|
||||
}
|
||||
|
||||
private static let eventHandlerName = "elementx"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user