add back notifications delay, disable unmessagable toggle unless it is a supported version

This commit is contained in:
Garth Vander Houwen 2025-05-23 23:13:12 -07:00
parent 8e198577e9
commit 18ef8890cb
2 changed files with 5 additions and 4 deletions

View file

@ -70,8 +70,8 @@ class LocalNotificationManager {
if notification.critical {
content.sound = UNNotificationSound.defaultCritical
}
let request = UNNotificationRequest(identifier: notification.id, content: content, trigger: nil)
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
let request = UNNotificationRequest(identifier: notification.id, content: content, trigger: trigger)
UNUserNotificationCenter.current().add(request) { error in
if let error {

View file

@ -30,9 +30,9 @@ struct UserConfig: View {
@State var overrideDutyCycle = false
@State var overrideFrequency: Float = 0.0
@State var txPower = 0
@FocusState var focusedField: Field?
public var minimumVersion = "2.6.8"
let floatFormatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
@ -97,13 +97,14 @@ struct UserConfig: View {
Text("The last 4 of the device MAC address will be appended to the short name to set the device's BLE Name. Short name can be up to 4 bytes long.")
.foregroundColor(.gray)
.font(.callout)
let supportedVersion = UserDefaults.firmwareVersion == "0.0.0" || self.minimumVersion.compare(UserDefaults.firmwareVersion, options: .numeric) == .orderedAscending || minimumVersion.compare(UserDefaults.firmwareVersion, options: .numeric) == .orderedSame
Toggle(isOn: $isUnmessagable) {
Label("Unmessagable", systemImage: "iphone.slash")
Text("Used to identify unmonitored or infrastructure nodes so that messaging is not avaliable to nodes that will never respond.")
.font(.caption2)
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
.disabled(!supportedVersion)
}
// Only manage ham mode for the locally connected node
if node?.num ?? 0 > 0 && node?.num ?? 0 == bleManager.connectedPeripheral?.num ?? 0 {