Merge pull request #3144 from pangeachat/hide-no-permission-unpin

Remove unpin tooltip/action when user does not have permission
This commit is contained in:
ggurdin 2025-06-18 14:56:20 -04:00 committed by GitHub
commit 622a36be05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -79,10 +79,20 @@ 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,
// onPressed: controller.room.canSendEvent(EventTypes.RoomPinnedEvents)
// ? () => controller.unpinEvent(event!.eventId)
// : null,
tooltip:
controller.room.canChangeStateEvent(EventTypes.RoomPinnedEvents)
? L10n.of(context).unpin
: null,
onPressed:
controller.room.canChangeStateEvent(EventTypes.RoomPinnedEvents)
? () => controller.unpinEvent(event!.eventId)
: null,
// Pangea#
),
onTap: () => _displayPinnedEventsDialog(context),
);