From 8d6aa9e88bc2a6594593ebcd7180d7cc51efd446 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 15 Mar 2024 14:29:50 -0700 Subject: [PATCH] stop device role save crash --- Meshtastic/Views/Settings/Config/DeviceConfig.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Meshtastic/Views/Settings/Config/DeviceConfig.swift b/Meshtastic/Views/Settings/Config/DeviceConfig.swift index 6e190609..4ffa72b9 100644 --- a/Meshtastic/Views/Settings/Config/DeviceConfig.swift +++ b/Meshtastic/Views/Settings/Config/DeviceConfig.swift @@ -23,7 +23,7 @@ struct DeviceConfig: View { @State var serialEnabled = true @State var debugLogEnabled = false @State var rebroadcastMode = 0 - @State var nodeInfoBroadcastSecs = 900 + @State var nodeInfoBroadcastSecs = 10800 @State var doubleTapAsButtonPress = false @State var isManaged = false @@ -176,6 +176,9 @@ struct DeviceConfig: View { dc.buttonGpio = UInt32(buttonGPIO) dc.buzzerGpio = UInt32(buzzerGPIO) dc.rebroadcastMode = RebroadcastModes(rawValue: rebroadcastMode)?.protoEnumValue() ?? RebroadcastModes.all.protoEnumValue() + if nodeInfoBroadcastSecs < 0 { + nodeInfoBroadcastSecs = 10800 + } dc.nodeInfoBroadcastSecs = UInt32(nodeInfoBroadcastSecs) dc.doubleTapAsButtonPress = doubleTapAsButtonPress dc.isManaged = isManaged