Handle location send interval of 0

This commit is contained in:
Garth Vander Houwen 2024-01-14 10:57:07 -08:00
parent 9f7f59fa87
commit 61168e826c

View file

@ -143,7 +143,13 @@ struct AppSettings: View {
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?")
})
.onAppear {
self.bleManager.context = context
if provideLocationInterval <= 0 {
provideLocationInterval = 30
UserDefaults.provideLocationInterval = provideLocationInterval
}
if self.bleManager.context == nil {
self.bleManager.context = context
}
}
.onChange(of: blockRangeTest) { newBlockRangeTest in
UserDefaults.blockRangeTest = newBlockRangeTest