From c1c3e60616df0d9e774a0a90acab21c217cfd41c Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Mon, 27 Apr 2026 21:41:14 +0200 Subject: [PATCH] only stop the session when receiving a not live error --- .../Sources/Services/Room/JoinedRoomProxy.swift | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift index 394ff22c0..0ba8300ec 100644 --- a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift +++ b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift @@ -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))