mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Call clearStaleNodes at start of sendWantConfig (#1535)
This commit is contained in:
parent
575cb887b0
commit
9ca951b179
4 changed files with 11 additions and 1 deletions
|
|
@ -16733,6 +16733,7 @@
|
|||
}
|
||||
},
|
||||
"Favorited and ignored nodes are always retained. Nodes without PKC keys are cleared from the app database on the schedule set by the user, nodes with PKC keys are cleared only if the interval is set to 7 days or longer. This feature only purges nodes from the app that are not stored in the device node database." : {
|
||||
"extractionState" : "stale",
|
||||
"localizations" : {
|
||||
"de" : {
|
||||
"stringUnit" : {
|
||||
|
|
@ -16759,6 +16760,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Favorited and ignored nodes are always retained. Other nodes are cleared from the app database on the schedule set by the user. (Nodes with PKC keys are always retained for at least 7 days.) This feature only purges nodes from the app that are not stored in the device node database." : {
|
||||
|
||||
},
|
||||
"Favorites" : {
|
||||
"localizations" : {
|
||||
|
|
|
|||
|
|
@ -196,6 +196,8 @@ class AccessoryManager: ObservableObject, MqttClientProxyManagerDelegate {
|
|||
Logger.transport.error("Unable to send wantConfig (config): No device connected")
|
||||
return
|
||||
}
|
||||
|
||||
_ = clearStaleNodes(nodeExpireDays: Int(UserDefaults.purgeStaleNodeDays), context: self.context)
|
||||
|
||||
try await withTaskCancellationHandler {
|
||||
var toRadio: ToRadio = ToRadio()
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ extension UserDefaults {
|
|||
case showDeviceOnboarding
|
||||
case usageDataAndCrashReporting
|
||||
case autoconnectOnDiscovery
|
||||
case purgeStaleNodeDays
|
||||
case manualConnections
|
||||
case testIntEnum
|
||||
}
|
||||
|
|
@ -178,6 +179,9 @@ extension UserDefaults {
|
|||
@UserDefault(.autoconnectOnDiscovery, defaultValue: true)
|
||||
static var autoconnectOnDiscovery: Bool
|
||||
|
||||
@UserDefault(.purgeStaleNodeDays, defaultValue: 0)
|
||||
static var purgeStaleNodeDays: Double
|
||||
|
||||
@UserDefault(.testIntEnum, defaultValue: .one)
|
||||
static var testIntEnum: TestIntEnum
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ struct AppSettings: View {
|
|||
Text("180")
|
||||
}
|
||||
}
|
||||
Text("Favorited and ignored nodes are always retained. Nodes without PKC keys are cleared from the app database on the schedule set by the user, nodes with PKC keys are cleared only if the interval is set to 7 days or longer. This feature only purges nodes from the app that are not stored in the device node database.")
|
||||
Text("Favorited and ignored nodes are always retained. Other nodes are cleared from the app database on the schedule set by the user. (Nodes with PKC keys are always retained for at least 7 days.) This feature only purges nodes from the app that are not stored in the device node database.")
|
||||
.foregroundStyle(.secondary)
|
||||
.font(idiom == .phone ? .caption : .callout)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue