fix pin message flow

This commit is contained in:
Salvatore Giordano
2021-06-11 13:07:03 +02:00
parent f793dba97a
commit a5776fcf02
@@ -366,13 +366,13 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
void _togglePin() async {
final channel = StreamChannel.of(context).channel;
Navigator.pop(context);
try {
if (!widget.message.pinned) {
await channel.pinMessage(widget.message);
} else {
await channel.unpinMessage(widget.message);
}
Navigator.pop(context);
} catch (e) {
_showErrorAlert();
}