refactor: handle Position packets sent from phone

pull/759/head
andrekir 2023-10-08 19:20:13 -03:00
rodzic c8e9410f5c
commit 17982efbea
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -469,7 +469,7 @@ class UIViewModel @Inject constructor(
// If the packet contains position data then use it to update, if valid
packet.position?.let { position ->
positionToPos.invoke(position)?.let {
nodePositions[proto.from] = position
nodePositions[proto.from.takeIf { it != 0 } ?: myNodeNum] = position
}
}