From a37266fc3d07d57d76a77c654cae4c75687c539c Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:00:08 -0500 Subject: [PATCH] feat: disable send button if fetching IGC (#1427) --- .../choreographer/widgets/send_button.dart | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/lib/pangea/choreographer/widgets/send_button.dart b/lib/pangea/choreographer/widgets/send_button.dart index fd09fda08..5abeab51e 100644 --- a/lib/pangea/choreographer/widgets/send_button.dart +++ b/lib/pangea/choreographer/widgets/send_button.dart @@ -41,27 +41,19 @@ class ChoreographerSendButtonState extends State { @override Widget build(BuildContext context) { - return - // widget.controller.choreographer.isFetching && - // widget.controller.choreographer.isAutoIGCEnabled - // ? Container( - // height: 56, - // width: 56, - // padding: const EdgeInsets.all(13), - // child: const CircularProgressIndicator(), - // ) - // : - Container( + return Container( height: 56, alignment: Alignment.center, child: IconButton( icon: const Icon(Icons.send_outlined), color: widget.controller.choreographer.assistanceState.stateColor(context), - onPressed: () { - widget.controller.choreographer.incrementTimesClicked(); - widget.controller.choreographer.send(context); - }, + onPressed: widget.controller.choreographer.isFetching + ? null + : () { + widget.controller.choreographer.incrementTimesClicked(); + widget.controller.choreographer.send(context); + }, tooltip: L10n.of(context).send, ), );