mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Sync up online timeframes with the stats at seen in the last 2 hours
This commit is contained in:
parent
b9d7c15883
commit
4361a082c5
3 changed files with 4 additions and 4 deletions
|
|
@ -52,8 +52,8 @@ extension NodeInfoEntity {
|
|||
}
|
||||
|
||||
var isOnline: Bool {
|
||||
let fifteenMinutesAgo = Calendar.current.date(byAdding: .minute, value: -15, to: Date())
|
||||
if lastHeard?.compare(fifteenMinutesAgo!) == .orderedDescending {
|
||||
let twoHoursAgo = Calendar.current.date(byAdding: .minute, value: -120, to: Date())
|
||||
if lastHeard?.compare(twoHoursAgo!) == .orderedDescending {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ struct UserList: View {
|
|||
}
|
||||
/// Online
|
||||
if isOnline {
|
||||
let isOnlinePredicate = NSPredicate(format: "userNode.lastHeard >= %@", Calendar.current.date(byAdding: .minute, value: -15, to: Date())! as NSDate)
|
||||
let isOnlinePredicate = NSPredicate(format: "userNode.lastHeard >= %@", Calendar.current.date(byAdding: .minute, value: -120, to: Date())! as NSDate)
|
||||
predicates.append(isOnlinePredicate)
|
||||
}
|
||||
/// Encrypted
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ struct NodeList: View {
|
|||
}
|
||||
/// Online
|
||||
if isOnline {
|
||||
let isOnlinePredicate = NSPredicate(format: "lastHeard >= %@", Calendar.current.date(byAdding: .minute, value: -15, to: Date())! as NSDate)
|
||||
let isOnlinePredicate = NSPredicate(format: "lastHeard >= %@", Calendar.current.date(byAdding: .minute, value: -120, to: Date())! as NSDate)
|
||||
predicates.append(isOnlinePredicate)
|
||||
}
|
||||
/// Encrypted
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue