kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
refactor(NodeMenu): always show remote admin menu item
rodzic
9aaaea1898
commit
f0f9235223
|
@ -550,9 +550,6 @@ class UIViewModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
val hasAdminChannel: Boolean
|
||||
get() = channelSet.settingsList.any { it.name.equals("admin", ignoreCase = true) }
|
||||
|
||||
/**
|
||||
* Write the persisted packet data out to a CSV file in the specified location.
|
||||
*/
|
||||
|
|
|
@ -12,7 +12,6 @@ internal fun View.nodeMenu(
|
|||
node: NodeInfo,
|
||||
ignoreIncomingList: List<Int>,
|
||||
isOurNode: Boolean = false,
|
||||
showAdmin: Boolean = false,
|
||||
isManaged: Boolean = false,
|
||||
onMenuItemAction: MenuItem.() -> Unit,
|
||||
) = PopupMenu(context, this, Gravity.NO_GRAVITY, R.attr.actionOverflowMenuStyle, 0).apply {
|
||||
|
@ -21,7 +20,6 @@ internal fun View.nodeMenu(
|
|||
inflate(R.menu.menu_nodes)
|
||||
menu.apply {
|
||||
setGroupVisible(R.id.group_remote, !isOurNode)
|
||||
setGroupVisible(R.id.group_admin, showAdmin)
|
||||
setGroupEnabled(R.id.group_admin, !isManaged)
|
||||
findItem(R.id.ignore).apply {
|
||||
isEnabled = isIgnored || ignoreIncomingList.size < 3
|
||||
|
|
|
@ -45,7 +45,6 @@ class UsersFragment : ScreenFragment("Users"), Logging {
|
|||
node = node,
|
||||
ignoreIncomingList = ignoreIncomingList,
|
||||
isOurNode = isOurNode,
|
||||
showAdmin = isOurNode || model.hasAdminChannel,
|
||||
isManaged = model.isManaged,
|
||||
) {
|
||||
when (itemId) {
|
||||
|
|
Ładowanie…
Reference in New Issue