fix: incorrect admin channel index retrieval logic

was returning -1 instead of 0 when no admin channel configured.
master
andrekir 2023-05-24 06:17:32 -03:00
rodzic 9869a9208b
commit 93ac0186fe
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -457,7 +457,8 @@ class MeshService : Service(), Logging {
/// Admin channel index
private val adminChannelIndex: Int
get() = channelSet.settingsList.map { it.name.lowercase() }.indexOf("admin")
get() = channelSet.settingsList.indexOfFirst { it.name.lowercase() == "admin" }
.coerceAtLeast(0)
/// Generate a new mesh packet builder with our node as the sender, and the specified node num
private fun newMeshPacketTo(idNum: Int) = MeshPacket.newBuilder().apply {