Channel context menu: hide Delete for the default channel (it can be renamed but not deleted; server already enforces this)

This commit is contained in:
ARIA committed 2026-08-20 21:00:36 +02:00
1 parent 49b7a3f577
commit d16b47abdf
1 file changed
+4 -1
@@ -1082,7 +1082,8 @@ private fun IconImage(base64: String, size: Dp) {
/**
* Long-press / right-click context menu for a channel row: rename, favorite
* (state-aware), icon (state-aware), delete.
* (state-aware), icon (state-aware), delete. The default channel cannot be
* deleted (the server enforces this too), so its "Delete" item is hidden.
*/
@Composable
private fun ChannelContextMenu(
@@ -1105,9 +1106,11 @@ private fun ChannelContextMenu(
text = { Text(if (hasIcon) "Change icon" else "Add icon") },
onClick = { onDismiss(); onEditIcon() },
)
if (!ch.isDefault) {
DropdownMenuItem(text = { Text("Delete") }, onClick = { onDismiss(); onDelete() })
}
}
}
/** Preset avatar colors for the channel-icon color picker. */
private val AVATAR_COLORS = listOf(