mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-08-04 15:03:00 +10:00
Formatted
This commit is contained in:
@@ -555,7 +555,8 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
for (final c in withLocation) {
|
for (final c in withLocation) {
|
||||||
if (c.type == advTypeRepeater) {
|
if (c.type == advTypeRepeater) {
|
||||||
if (repeaterByHash.containsKey(c.publicKey[0])) {
|
if (repeaterByHash.containsKey(c.publicKey[0])) {
|
||||||
repeaterByHash[c.publicKey[0]] = null; // collision: can't disambiguate
|
repeaterByHash[c.publicKey[0]] =
|
||||||
|
null; // collision: can't disambiguate
|
||||||
} else {
|
} else {
|
||||||
repeaterByHash[c.publicKey[0]] = c;
|
repeaterByHash[c.publicKey[0]] = c;
|
||||||
}
|
}
|
||||||
@@ -696,9 +697,7 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
const distance = Distance();
|
const distance = Distance();
|
||||||
final maxDistM = maxRangeKm * 2000;
|
final maxDistM = maxRangeKm * 2000;
|
||||||
return anchors
|
return anchors
|
||||||
.where(
|
.where((a) => anchors.any((b) => b != a && distance(a, b) <= maxDistM))
|
||||||
(a) => anchors.any((b) => b != a && distance(a, b) <= maxDistM),
|
|
||||||
)
|
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -257,10 +257,7 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||||||
if (contact != null && contact.hasLocation) continue;
|
if (contact != null && contact.hasLocation) continue;
|
||||||
final peers = connector.contacts
|
final peers = connector.contacts
|
||||||
.where(
|
.where(
|
||||||
(c) =>
|
(c) => c.hasLocation && c.path.isNotEmpty && c.path.last == hop,
|
||||||
c.hasLocation &&
|
|
||||||
c.path.isNotEmpty &&
|
|
||||||
c.path.last == hop,
|
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
if (peers.isNotEmpty) {
|
if (peers.isNotEmpty) {
|
||||||
|
|||||||
Reference in New Issue
Block a user