From 2715ffdb17abb611f3b25484d6fa78ee717b2890 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Fri, 3 Apr 2026 15:24:15 +0200 Subject: [PATCH] force the timeline to render as expired as soon as the stop button is pressed --- .../TimelineItemViews/LiveLocationRoomTimelineView.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift index 2ff83e778..693f65dc2 100644 --- a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift +++ b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift @@ -174,7 +174,7 @@ struct LiveLocationRoomTimelineView: View { if isLive, timelineItem.isOutgoing { Button { - context?.send(viewAction: .stopLiveLocationSharing) + stop() } label: { CompoundIcon(\.stop, size: .small, relativeTo: .compound.bodySMSemibold) .foregroundStyle(.compound.iconOnSolidPrimary) @@ -189,7 +189,12 @@ struct LiveLocationRoomTimelineView: View { .background(blurBackground) } - // MARK: - Private + private func stop() { + hasExpired = true + context?.send(viewAction: .stopLiveLocationSharing) + } + + // MARK: - Constants private let mapAspectRatio: Double = 3 / 2 private let mapMaxHeight: Double = 300