Location centring user's sharing location (#7398)

* fix issue on timeline bubbles not showing proper content after decrypt

* fix location sharing centring to other users

* Update RiotSwiftUI/Modules/LocationSharing/LiveLocationSharingViewer/LiveLocationSharingViewerViewModel.swift

Co-authored-by: Alfonso Grillo <alfogrillo@element.io>

---------

Co-authored-by: Alfonso Grillo <alfogrillo@element.io>
This commit is contained in:
Flescio
2023-03-02 11:28:00 +01:00
committed by GitHub
parent 11ce4a2ca6
commit c7d6dd25a2
13 changed files with 53 additions and 22 deletions
@@ -40,7 +40,7 @@ class LocationSharingViewModel: LocationSharingViewModelType, LocationSharingVie
userAvatarData: avatarData,
annotations: [],
highlightedAnnotation: nil,
showsUserLocation: true,
showsUserLocationMode: .follow,
isLiveLocationSharingEnabled: isLiveLocationSharingEnabled)
super.init(initialViewState: viewState)
@@ -73,7 +73,7 @@ class LocationSharingViewModel: LocationSharingViewModelType, LocationSharingVie
completion?(.share(latitude: pinLocation.latitude, longitude: pinLocation.longitude, coordinateType: .pin))
case .goToUserLocation:
state.showsUserLocation = true
state.showsUserLocationMode = .follow
state.isPinDropSharing = false
case .startLiveSharing:
startLiveLocationSharing()
@@ -81,7 +81,7 @@ class LocationSharingViewModel: LocationSharingViewModelType, LocationSharingVie
state.bindings.showingTimerSelector = false
completion?(.shareLiveLocation(timeout: timeout.rawValue))
case .userDidPan:
state.showsUserLocation = false
state.showsUserLocationMode = .hide
state.isPinDropSharing = true
case .mapCreditsDidTap:
state.bindings.showMapCreditsSheet.toggle()