From 2337f92d7ea53936518b11d3b8637590f2334675 Mon Sep 17 00:00:00 2001 From: Vishnu Ravi Date: Sat, 11 Jan 2025 15:01:02 -0500 Subject: [PATCH] Update alert --- LifeSpace/Map/LifeSpaceMapView.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/LifeSpace/Map/LifeSpaceMapView.swift b/LifeSpace/Map/LifeSpaceMapView.swift index b2be966..9be53b4 100644 --- a/LifeSpace/Map/LifeSpaceMapView.swift +++ b/LifeSpace/Map/LifeSpaceMapView.swift @@ -18,7 +18,7 @@ struct LifeSpaceMapView: View { @State private var presentedContext: EventContext? @Binding private var presentingAccount: Bool - @State private var showingSurveyAlert = false + @State private var showingAlert = false @State private var alertMessage = "" @State private var showingSurvey = false @State private var optionsPanelOpen = true @@ -63,6 +63,13 @@ struct LifeSpaceMapView: View { } } } + .alert("Error", isPresented: $showingAlert) { + Button("OK", role: .cancel) { + showingAlert = false + } + } message: { + Text(alertMessage) + } .onAppear { refreshMap() } @@ -116,7 +123,7 @@ struct LifeSpaceMapView: View { try await locationModule.fetchLocations() } catch { alertMessage = error.localizedDescription - showingSurveyAlert = true + showingAlert = true } isRefreshing = false }