Fix lingering scanned but missing ble devices

This commit is contained in:
Garth Vander Houwen 2022-05-28 01:41:55 -07:00
parent b6e7f614a5
commit 4847731402
2 changed files with 4 additions and 4 deletions

View file

@ -755,7 +755,7 @@
CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\"";
DEVELOPMENT_TEAM = GCH7VS5Y9R;
ENABLE_PREVIEWS = YES;
@ -787,7 +787,7 @@
CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 9;
DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\"";
DEVELOPMENT_TEAM = GCH7VS5Y9R;
ENABLE_PREVIEWS = YES;

View file

@ -195,8 +195,8 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
}
let today = Date()
let oneMinuteAgo = Calendar.current.date(byAdding: .minute, value: -1, to: today)!
peripherals.removeAll(where: { $0.lastUpdate <= oneMinuteAgo})
let visibleDuration = Calendar.current.date(byAdding: .second, value: -5, to: today)!
peripherals.removeAll(where: { $0.lastUpdate <= visibleDuration})
}
// Called when a peripheral is connected