implement the stop action in the LiveLocationRoomTimelineView

This commit is contained in:
Mauro Romito
2026-04-02 21:54:09 +02:00
committed by Mauro
parent 0fb321576d
commit a5054f506a
3 changed files with 7 additions and 1 deletions

View File

@@ -70,6 +70,8 @@ enum TimelineViewAction {
case handlePollAction(TimelineViewPollAction)
case handleAudioPlayerAction(TimelineAudioPlayerAction)
case stopLiveLocationSharing
/// Focus the timeline onto the specified event ID (switching to a detached timeline if needed).
case focusOnEventID(String)
/// Switch back to a live timeline (from a detached one).

View File

@@ -199,6 +199,8 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
handlePollAction(pollAction)
case .handleAudioPlayerAction(let audioPlayerAction):
handleAudioPlayerAction(audioPlayerAction)
case .stopLiveLocationSharing:
Task { await userSession.liveLocationManager.stopLiveLocation(roomID: state.roomID) }
case .focusOnEventID(let eventID):
Task { await focusOnEvent(eventID: eventID) }
case .focusLive:

View File

@@ -173,7 +173,9 @@ struct LiveLocationRoomTimelineView: View {
Spacer()
if isLive, timelineItem.isOutgoing {
Button { } label: {
Button {
context?.send(viewAction: .stopLiveLocationSharing)
} label: {
CompoundIcon(\.stop, size: .small, relativeTo: .compound.bodySMSemibold)
.foregroundStyle(.compound.iconOnSolidPrimary)
.padding(5)