diff --git a/Meshtastic/Helpers/Extensions.swift b/Meshtastic/Helpers/Extensions.swift index 51a02608..f4b6a0ae 100644 --- a/Meshtastic/Helpers/Extensions.swift +++ b/Meshtastic/Helpers/Extensions.swift @@ -165,3 +165,25 @@ extension String { } } } + +extension UserDefaults { + + enum Keys: String, CaseIterable { + case meshtasticUsername + case preferredPeripheralId + case provideLocation + case provideLocationInterval + case keyboardType + case meshMapType + case meshMapCenteringMode + case meshMapRecentering + case meshMapCustomTileServer + case meshMapUserTrackingMode + case meshMapShowNodeHistory + case meshMapShowRouteLines + } + + func reset() { + Keys.allCases.forEach { removeObject(forKey: $0.rawValue) } + } +} diff --git a/Meshtastic/Views/Nodes/DeviceMetricsLog.swift b/Meshtastic/Views/Nodes/DeviceMetricsLog.swift index a99d98a4..13c41f31 100644 --- a/Meshtastic/Views/Nodes/DeviceMetricsLog.swift +++ b/Meshtastic/Views/Nodes/DeviceMetricsLog.swift @@ -36,7 +36,7 @@ struct DeviceMetricsLog: View { x: .value("Hour", $0.time!.formattedDate(format: "ha")), y: .value("Value", $0.batteryLevel) ) - .interpolationMethod(.cardinal) + .interpolationMethod(.linear) .foregroundStyle(.blue) PointMark( x: .value("Hour", $0.time!.formattedDate(format: "ha")), diff --git a/Meshtastic/Views/Settings/AppSettings.swift b/Meshtastic/Views/Settings/AppSettings.swift index ec83fae9..dae61991 100644 --- a/Meshtastic/Views/Settings/AppSettings.swift +++ b/Meshtastic/Views/Settings/AppSettings.swift @@ -117,6 +117,8 @@ struct AppSettings: View { Button("Erase all app data?", role: .destructive) { bleManager.disconnectPeripheral() clearCoreDataDatabase(context: context) + UserDefaults.standard.reset() + UserDefaults.standard.synchronize() } } }