Remove unpin tooltip/action when user does not have permission

This commit is contained in:
Kelrap 2025-06-18 13:45:56 -04:00
parent 6f82808c8e
commit 9dce1a856d

View file

@ -79,10 +79,18 @@ class PinnedEvents extends StatelessWidget {
iconSize: 18,
color: theme.colorScheme.onSurfaceVariant,
icon: const Icon(Icons.push_pin),
tooltip: L10n.of(context).unpin,
onPressed: controller.room.canSendEvent(EventTypes.RoomPinnedEvents)
? () => controller.unpinEvent(event!.eventId)
: null,
// #Pangea
// tooltip: L10n.of(context).unpin,
tooltip:
controller.room.canChangeStateEvent(EventTypes.RoomPinnedEvents)
? L10n.of(context).unpin
: null,
// onPressed: controller.room.canSendEvent(EventTypes.RoomPinnedEvents)
onPressed:
controller.room.canChangeStateEvent(EventTypes.RoomPinnedEvents)
// Pangea#
? () => controller.unpinEvent(event!.eventId)
: null,
),
onTap: () => _displayPinnedEventsDialog(context),
);