fix: improve BLE scanning reliability and filter out own node from contacts list improve text scaling

This commit is contained in:
zjs81
2026-01-24 00:17:18 -07:00
parent fa514533eb
commit 09e1cd2b8d
2 changed files with 42 additions and 14 deletions
+11
View File
@@ -625,6 +625,17 @@ class MeshCoreConnector extends ChangeNotifier {
_scanResults.clear();
_setState(MeshCoreConnectionState.scanning);
// Ensure any previous scan is fully stopped
await FlutterBluePlus.stopScan();
await _scanSubscription?.cancel();
// On iOS/macOS, add a small delay to allow BLE stack to reset
// This prevents cached results from interfering with new scans
if (defaultTargetPlatform == TargetPlatform.iOS ||
defaultTargetPlatform == TargetPlatform.macOS) {
await Future.delayed(const Duration(milliseconds: 300));
}
_scanSubscription = FlutterBluePlus.scanResults.listen((results) {
_scanResults.clear();
for (var result in results) {