fix double entry due to mixed 1byte and 2byte paths

This commit is contained in:
ericz
2026-05-18 21:30:37 +02:00
parent 87708e2684
commit 91759f531a
2 changed files with 116 additions and 7 deletions
+10
View File
@@ -12,9 +12,18 @@ import 'signal_ui.dart';
Contact? _getRepeaterPrefixMatchNearLocation(
List<Contact> contacts,
List<int> pubkeyPrefix, {
String? contactKeyHex,
LatLng? searchPoint,
bool preferFavorites = false,
}) {
if (contactKeyHex != null) {
for (final c in contacts) {
if (c.publicKeyHex == contactKeyHex) {
return c;
}
}
}
final candidates = contacts
.where(
(c) =>
@@ -242,6 +251,7 @@ class _SNRIndicatorState extends State<SNRIndicator> {
final contact = _getRepeaterPrefixMatchNearLocation(
allContacts,
repeater.pubkeyPrefix,
contactKeyHex: repeater.contactKeyHex,
searchPoint: selfPoint,
preferFavorites: true,
);