chore: Hide topic if empty and cannot be changed

This commit is contained in:
Christian Kußowski 2025-09-25 14:45:42 +02:00
commit 0a23dca11e
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -207,6 +207,8 @@ class ChatDetailsView extends StatelessWidget {
),
],
),
if (room.canChangeStateEvent(EventTypes.RoomTopic) ||
room.topic.isNotEmpty) ...[
Divider(color: theme.dividerColor),
ListTile(
title: Text(
@ -216,11 +218,12 @@ class ChatDetailsView extends StatelessWidget {
fontWeight: FontWeight.bold,
),
),
trailing: room
.canChangeStateEvent(EventTypes.RoomTopic)
trailing:
room.canChangeStateEvent(EventTypes.RoomTopic)
? IconButton(
onPressed: controller.setTopicAction,
tooltip: L10n.of(context).setChatDescription,
tooltip:
L10n.of(context).setChatDescription,
icon: const Icon(Icons.edit_outlined),
)
: null,
@ -254,6 +257,7 @@ class ChatDetailsView extends StatelessWidget {
),
),
const SizedBox(height: 16),
],
Divider(color: theme.dividerColor),
ListTile(
leading: CircleAvatar(