only stop the session when receiving a not live error

This commit is contained in:
Mauro Romito
2026-04-27 21:41:14 +02:00
committed by Mauro
parent 5ec47c2580
commit c1c3e60616

View File

@@ -772,16 +772,9 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
do {
try await room.sendLiveLocation(geoUri: geoURI.string)
return .success(())
} catch let error as LiveLocationError {
switch error {
case .Network:
MXLog.error("Failed sending live location with error: \(error)")
return .failure(.sdkError(error))
// We can consider the session not active for any error other the Network one.
default:
MXLog.error("Failed sending live location, session is not active")
return .failure(.liveLocationSessionIsNotActive)
}
} catch LiveLocationError.NotLive {
MXLog.error("Failed sending live location, session is not active")
return .failure(.liveLocationSessionIsNotActive)
} catch {
MXLog.error("Failed sending live location with error: \(error)")
return .failure(.sdkError(error))