mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Close location view hack
This commit is contained in:
parent
d6245e33b1
commit
72979888da
1 changed files with 22 additions and 25 deletions
|
|
@ -171,33 +171,21 @@ struct DeviceOnboarding: View {
|
|||
}
|
||||
.padding()
|
||||
Spacer()
|
||||
if locationStatus == .notDetermined {
|
||||
Button {
|
||||
Task {
|
||||
locationStatus = await LocationsHandler.shared.requestLocationAlwaysPermissions() // LocationsHandler.shared.requestLocationAlwaysPermissions()
|
||||
}
|
||||
} label: {
|
||||
Text("Configure Location Permissions")
|
||||
.frame(maxWidth: .infinity)
|
||||
Button {
|
||||
Task {
|
||||
await requestLocationPermissions()
|
||||
await goToNextStep(after: .location)
|
||||
}
|
||||
.padding()
|
||||
.buttonBorderShape(.capsule)
|
||||
.controlSize(.large)
|
||||
.padding()
|
||||
.buttonStyle(.borderedProminent)
|
||||
} else {
|
||||
Button {
|
||||
dismiss()
|
||||
} label: {
|
||||
Text("Finish")
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.padding()
|
||||
.buttonBorderShape(.capsule)
|
||||
.controlSize(.large)
|
||||
.padding()
|
||||
.buttonStyle(.borderedProminent)
|
||||
dismiss()
|
||||
} label: {
|
||||
Text("Configure Location Permissions")
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.padding()
|
||||
.buttonBorderShape(.capsule)
|
||||
.controlSize(.large)
|
||||
.padding()
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -285,4 +273,13 @@ struct DeviceOnboarding: View {
|
|||
Logger.services.error("Notification permissions error: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
|
||||
func requestLocationPermissions() async {
|
||||
locationStatus = await LocationsHandler.shared.requestLocationAlwaysPermissions()
|
||||
if locationStatus != .notDetermined {
|
||||
Logger.services.info("Notification permissions are enabled")
|
||||
} else {
|
||||
Logger.services.info("Notification permissions denied")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue