kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
refactor: remote admin channel validation
rodzic
902d1697a9
commit
5983424d48
|
@ -423,9 +423,8 @@ class UIViewModel @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val adminChannelIndex: Int /** matches [MeshService.adminChannelIndex] **/
|
val hasAdminChannel: Boolean
|
||||||
get() = channelSet.settingsList.indexOfFirst { it.name.equals("admin", ignoreCase = true) }
|
get() = channelSet.settingsList.any { it.name.equals("admin", ignoreCase = true) }
|
||||||
.coerceAtLeast(0)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the persisted packet data out to a CSV file in the specified location.
|
* Write the persisted packet data out to a CSV file in the specified location.
|
||||||
|
|
|
@ -101,7 +101,7 @@ class UsersFragment : ScreenFragment("Users"), Logging {
|
||||||
if (!model.isConnected()) return
|
if (!model.isConnected()) return
|
||||||
val node = nodes[position]
|
val node = nodes[position]
|
||||||
val user = node.user ?: return
|
val user = node.user ?: return
|
||||||
val showAdmin = position == 0 || model.adminChannelIndex > 0
|
val showAdmin = position == 0 || model.hasAdminChannel
|
||||||
val isIgnored = ignoreIncomingList.contains(node.num)
|
val isIgnored = ignoreIncomingList.contains(node.num)
|
||||||
val popup = PopupMenu(requireContext(), view)
|
val popup = PopupMenu(requireContext(), view)
|
||||||
popup.inflate(R.menu.menu_nodes)
|
popup.inflate(R.menu.menu_nodes)
|
||||||
|
|
Ładowanie…
Reference in New Issue