diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 10395de9e..4cacf7f18 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1167,6 +1167,13 @@ class ChatController extends State } void sendAgainAction() { + // #Pangea + if (selectedEvents.isEmpty) { + ErrorHandler.logError(e: "No selected events in send again action"); + clearSelectedEvents(); + return; + } + // Pangea# final event = selectedEvents.first; if (event.status.isError) { event.sendAgain(); diff --git a/lib/pages/chat/chat_input_row.dart b/lib/pages/chat/chat_input_row.dart index 0167d5d21..9b0e5883f 100644 --- a/lib/pages/chat/chat_input_row.dart +++ b/lib/pages/chat/chat_input_row.dart @@ -96,43 +96,67 @@ class ChatInputRow extends StatelessWidget { else // Pangea# controller.selectedEvents.length == 1 - ? controller.selectedEvents.first - .getDisplayEvent(controller.timeline!) - .status - .isSent - ? SizedBox( - height: height, - child: TextButton( - onPressed: controller.replyAction, - child: Row( - children: [ - // #Pangea - // Text(L10n.of(context)!.reply), - // const Icon(Icons.keyboard_arrow_right), - const Icon(Symbols.reply), - const SizedBox(width: 6), - Text(L10n.of(context)!.reply), - // Pangea# - ], - ), - ), - ) - : SizedBox( - height: height, - child: TextButton( - onPressed: controller.sendAgainAction, - child: Row( - children: [ - Text(L10n.of(context)!.tryToSendAgain), - const SizedBox(width: 4), - const Icon(Icons.send_outlined, size: 16), - ], - ), - ), - ) + ? + // #Pangea + // controller.selectedEvents.first + // .getDisplayEvent(controller.timeline!) + // .status + // .isSent + // ? + // Pangea# + SizedBox( + height: height, + child: TextButton( + onPressed: controller.replyAction, + child: Row( + children: [ + // #Pangea + // Text(L10n.of(context)!.reply), + // const Icon(Icons.keyboard_arrow_right), + const Icon(Symbols.reply), + const SizedBox(width: 6), + Text(L10n.of(context)!.reply), + // Pangea# + ], + ), + ), + ) + // #Pangea + // : SizedBox( + // height: height, + // child: TextButton( + // onPressed: controller.sendAgainAction, + // child: Row( + // children: [ + // Text(L10n.of(context)!.tryToSendAgain), + // const SizedBox(width: 4), + // const Icon(Icons.send_outlined, size: 16), + // ], + // ), + // ), + // ) + // Pangea# : const SizedBox.shrink(), // #Pangea PangeaReactionsPicker(controller), + if (controller.selectedEvents.length == 1 && + !controller.selectedEvents.first + .getDisplayEvent(controller.timeline!) + .status + .isSent) + SizedBox( + height: height, + child: TextButton( + onPressed: controller.sendAgainAction, + child: Row( + children: [ + Text(L10n.of(context)!.tryToSendAgain), + const SizedBox(width: 4), + const Icon(Icons.send_outlined, size: 16), + ], + ), + ), + ), // Pangea# ] : [