Minimum expiry for PKI nodes

This commit is contained in:
Garth Vander Houwen 2025-06-19 16:06:02 -07:00
parent 6ed183d155
commit 0f21ea9599
2 changed files with 5 additions and 1 deletions

View file

@ -13,7 +13,7 @@ public func clearStaleNodes(nodeExpireDays: Int, context: NSManagedObjectContext
return TimeInterval(-nodeExpireDays * 86400)
}
var nodePKIExpireTime: TimeInterval {
return TimeInterval(-7 * 86400)
return TimeInterval((nodeExpireDays < 7 ? -7 : -nodeExpireDays) * 86400)
}
if nodeExpireDays == 0 {

View file

@ -6,6 +6,7 @@ import MapKit
import OSLog
struct AppSettings: View {
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
@Environment(\.managedObjectContext) var context
@EnvironmentObject var bleManager: BLEManager
@State var totalDownloadedTileSize = ""
@ -71,6 +72,9 @@ struct AppSettings: View {
Text("180")
}
}
Text("Nodes without PKI keys are cleared from the app database on the schedule set by the user, nodes with PKI keys are cleared only if the interval is set to 7 days or longer.")
.foregroundStyle(.secondary)
.font(idiom == .phone ? .caption : .callout)
}
Button {
isPresentingCoreDataResetConfirm = true