mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:02:10 +00:00
implement the stop action in the LiveLocationRoomTimelineView
This commit is contained in:
@@ -70,6 +70,8 @@ enum TimelineViewAction {
|
|||||||
case handlePollAction(TimelineViewPollAction)
|
case handlePollAction(TimelineViewPollAction)
|
||||||
case handleAudioPlayerAction(TimelineAudioPlayerAction)
|
case handleAudioPlayerAction(TimelineAudioPlayerAction)
|
||||||
|
|
||||||
|
case stopLiveLocationSharing
|
||||||
|
|
||||||
/// Focus the timeline onto the specified event ID (switching to a detached timeline if needed).
|
/// Focus the timeline onto the specified event ID (switching to a detached timeline if needed).
|
||||||
case focusOnEventID(String)
|
case focusOnEventID(String)
|
||||||
/// Switch back to a live timeline (from a detached one).
|
/// Switch back to a live timeline (from a detached one).
|
||||||
|
|||||||
@@ -199,6 +199,8 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
|||||||
handlePollAction(pollAction)
|
handlePollAction(pollAction)
|
||||||
case .handleAudioPlayerAction(let audioPlayerAction):
|
case .handleAudioPlayerAction(let audioPlayerAction):
|
||||||
handleAudioPlayerAction(audioPlayerAction)
|
handleAudioPlayerAction(audioPlayerAction)
|
||||||
|
case .stopLiveLocationSharing:
|
||||||
|
Task { await userSession.liveLocationManager.stopLiveLocation(roomID: state.roomID) }
|
||||||
case .focusOnEventID(let eventID):
|
case .focusOnEventID(let eventID):
|
||||||
Task { await focusOnEvent(eventID: eventID) }
|
Task { await focusOnEvent(eventID: eventID) }
|
||||||
case .focusLive:
|
case .focusLive:
|
||||||
|
|||||||
+3
-1
@@ -173,7 +173,9 @@ struct LiveLocationRoomTimelineView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
if isLive, timelineItem.isOutgoing {
|
if isLive, timelineItem.isOutgoing {
|
||||||
Button { } label: {
|
Button {
|
||||||
|
context?.send(viewAction: .stopLiveLocationSharing)
|
||||||
|
} label: {
|
||||||
CompoundIcon(\.stop, size: .small, relativeTo: .compound.bodySMSemibold)
|
CompoundIcon(\.stop, size: .small, relativeTo: .compound.bodySMSemibold)
|
||||||
.foregroundStyle(.compound.iconOnSolidPrimary)
|
.foregroundStyle(.compound.iconOnSolidPrimary)
|
||||||
.padding(5)
|
.padding(5)
|
||||||
|
|||||||
Reference in New Issue
Block a user