mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
add a spinner when starting LLS
This commit is contained in:
@@ -184,6 +184,11 @@ class LocationSharingScreenViewModel: LocationSharingScreenViewModelType, Locati
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func startLiveLocationSharingInRoom(duration: Duration) async {
|
private func startLiveLocationSharingInRoom(duration: Duration) async {
|
||||||
|
showLoader()
|
||||||
|
defer {
|
||||||
|
hideLoader()
|
||||||
|
}
|
||||||
|
|
||||||
let result = await liveLocationManager.startLiveLocation(roomID: roomProxy.id,
|
let result = await liveLocationManager.startLiveLocation(roomID: roomProxy.id,
|
||||||
duration: duration)
|
duration: duration)
|
||||||
|
|
||||||
@@ -222,15 +227,28 @@ class LocationSharingScreenViewModel: LocationSharingScreenViewModelType, Locati
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func showErrorIndicator() {
|
private func showErrorIndicator() {
|
||||||
userIndicatorController.submitIndicator(UserIndicator(id: statusIndicatorID,
|
userIndicatorController.submitIndicator(UserIndicator(id: Self.statusIndicatorID,
|
||||||
type: .toast,
|
type: .toast,
|
||||||
title: L10n.errorUnknown,
|
title: L10n.errorUnknown,
|
||||||
iconName: "xmark"))
|
iconName: "xmark"))
|
||||||
}
|
}
|
||||||
|
|
||||||
private var statusIndicatorID: String {
|
private func showLoader() {
|
||||||
"\(Self.self)-Status"
|
userIndicatorController.submitIndicator(UserIndicator(id: Self.loadingIndicatorID,
|
||||||
|
type: .modal(progress: .indeterminate,
|
||||||
|
interactiveDismissDisabled: true,
|
||||||
|
allowsInteraction: false),
|
||||||
|
title: L10n.commonLoading,
|
||||||
|
persistent: true))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func hideLoader() {
|
||||||
|
userIndicatorController.retractIndicatorWithId(Self.loadingIndicatorID)
|
||||||
|
}
|
||||||
|
|
||||||
|
private static let loadingIndicatorID = "\(LocationSharingScreenViewModel.self)-Loading"
|
||||||
|
|
||||||
|
private static let statusIndicatorID = "\(LocationSharingScreenViewModel.self)-Status"
|
||||||
}
|
}
|
||||||
|
|
||||||
extension LocationSharingScreenViewModel {
|
extension LocationSharingScreenViewModel {
|
||||||
|
|||||||
Reference in New Issue
Block a user