@@ -184,6 +184,10 @@ class LocationSharingScreenViewModel: LocationSharingScreenViewModelType, Locati
184184 }
185185
186186 private func startLiveLocationSharingInRoom( duration: Duration ) async {
187+ defer {
188+ hideLoader ( )
189+ }
190+
187191 let result = await liveLocationManager. startLiveLocation ( roomID: roomProxy. id,
188192 duration: duration)
189193
@@ -222,15 +226,28 @@ class LocationSharingScreenViewModel: LocationSharingScreenViewModelType, Locati
222226 }
223227
224228 private func showErrorIndicator( ) {
225- userIndicatorController. submitIndicator ( UserIndicator ( id: statusIndicatorID,
229+ userIndicatorController. submitIndicator ( UserIndicator ( id: Self . statusIndicatorID,
226230 type: . toast,
227231 title: L10n . errorUnknown,
228232 iconName: " xmark " ) )
229233 }
230234
231- private var statusIndicatorID : String {
232- " \( Self . self) -Status "
235+ private func showLoader( ) {
236+ userIndicatorController. submitIndicator ( UserIndicator ( id: Self . loadingIndicatorID,
237+ type: . modal( progress: . indeterminate,
238+ interactiveDismissDisabled: true ,
239+ allowsInteraction: false ) ,
240+ title: L10n . commonLoading,
241+ persistent: true ) )
242+ }
243+
244+ private func hideLoader( ) {
245+ userIndicatorController. retractIndicatorWithId ( Self . loadingIndicatorID)
233246 }
247+
248+ private static let loadingIndicatorID = " \( LocationSharingScreenViewModel . self) -Loading "
249+
250+ private static let statusIndicatorID = " \( LocationSharingScreenViewModel . self) -Status "
234251}
235252
236253extension LocationSharingScreenViewModel {
0 commit comments