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 { void _togglePin() async {
final channel = StreamChannel.of(context).channel; final channel = StreamChannel.of(context).channel;
Navigator.pop(context);
try { try {
if (!widget.message.pinned) { if (!widget.message.pinned) {
await channel.pinMessage(widget.message); await channel.pinMessage(widget.message);
} else { } else {
await channel.unpinMessage(widget.message); await channel.unpinMessage(widget.message);
} }
Navigator.pop(context);
} catch (e) { } catch (e) {
_showErrorAlert(); _showErrorAlert();
} }