6071: Add timeout selector when start live sharing

This commit is contained in:
MaximeE
2022-05-03 15:21:51 +02:00
parent b5e878c3df
commit 39f8f1aeb5
5 changed files with 52 additions and 10 deletions
@@ -25,12 +25,6 @@ typealias LocationSharingViewModelType = StateStoreViewModel<LocationSharingView
@available(iOS 14, *)
class LocationSharingViewModel: LocationSharingViewModelType, LocationSharingViewModelProtocol {
// MARK: - Constants
private enum Constants {
static let liveLocationSharingDefaultTimeout: TimeInterval = 300 // 5 minutes
}
// MARK: - Properties
// MARK: Private
@@ -80,8 +74,8 @@ class LocationSharingViewModel: LocationSharingViewModelType, LocationSharingVie
completion?(.share(latitude: pinLocation.latitude, longitude: pinLocation.longitude, coordinateType: .pin))
case .goToUserLocation:
state.bindings.pinLocation = nil
case .shareLiveLocation:
completion?(.shareLiveLocation(timeout: Constants.liveLocationSharingDefaultTimeout))
case .shareLiveLocation(let timeout):
completion?(.shareLiveLocation(timeout: timeout))
}
}