Login flow fixed
This commit is contained in:
@@ -4,9 +4,12 @@ import UIKit
|
||||
#endif
|
||||
|
||||
struct HomeView: View {
|
||||
@Binding var appState: AppState
|
||||
@State var searchText = ""
|
||||
@State var selectedCategory = "Stores"
|
||||
@State var scrollOffset: CGFloat = 0
|
||||
@State var hasRequestedLocation = false
|
||||
let locationService = LocationService()
|
||||
|
||||
private let categories: [CategoryModel] = [
|
||||
.init(title: "Stores", systemIcon: "storefront"),
|
||||
@@ -104,6 +107,15 @@ struct HomeView: View {
|
||||
.background(AppColors.backgroundLight)
|
||||
.ignoresSafeArea(edges: .top)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
|
||||
.onAppear {
|
||||
if hasRequestedLocation == false {
|
||||
hasRequestedLocation = true
|
||||
locationService.requestLocation { lat, lng in
|
||||
appState.address.latitude = lat
|
||||
appState.address.longitude = lng
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var contentStack: some View {
|
||||
@@ -175,7 +187,7 @@ struct HomeView: View {
|
||||
.foregroundStyle(AppColors.brandSoft)
|
||||
|
||||
HStack(spacing: 6) {
|
||||
Text("Canggu, Kuta Utara, Bali")
|
||||
Text(appState.address.display)
|
||||
.font(AppTypography.heading3)
|
||||
.foregroundStyle(AppColors.textInverse)
|
||||
Image(systemName: "chevron.down")
|
||||
|
||||
Reference in New Issue
Block a user