diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index d76fcff6a..af791f5bc 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1765,17 +1765,7 @@ class ChatController extends State PaywallCard.show(context, choreographer.inputTransformTargetKey); return; } on OpenMatchesException { - if (choreographer.firstOpenMatch != null) { - if (choreographer.firstOpenMatch!.updatedMatch.isITStart) { - choreographer.openIT(choreographer.firstOpenMatch!); - } else { - OverlayUtil.showIGCMatch( - choreographer.firstOpenMatch!, - choreographer, - context, - ); - } - } + onSelectMatch(choreographer.firstOpenMatch); return; } // Pangea# diff --git a/lib/pages/chat/input_bar.dart b/lib/pages/chat/input_bar.dart index 7f5b12d29..f06e87639 100644 --- a/lib/pages/chat/input_bar.dart +++ b/lib/pages/chat/input_bar.dart @@ -427,28 +427,21 @@ class InputBar extends StatelessWidget { // #Pangea void onInputTap(BuildContext context) { - // show the paywall if appropriate + if (controller == null || controller!.text.isEmpty) return; final choreographer = controller!.choreographer; - if (MatrixState - .pangeaController.subscriptionController.subscriptionStatus == - SubscriptionStatus.shouldShowPaywall && - controller!.text.isNotEmpty) { + + final subscriptionStatus = + MatrixState.pangeaController.subscriptionController.subscriptionStatus; + if (subscriptionStatus == SubscriptionStatus.shouldShowPaywall) { PaywallCard.show(context, choreographer.inputTransformTargetKey); return; } - // if there is no igc text data, then don't do anything - if (!choreographer.hasIGCTextData) return; - - final selection = controller!.selection; - if (selection.baseOffset >= controller!.text.length) { - return; - } - - final match = choreographer.igcController.getMatchByOffset( - selection.baseOffset, + choreographer.chatController.onSelectMatch( + choreographer.igcController.getMatchByOffset( + controller!.selection.baseOffset, + ), ); - choreographer.chatController.onSelectMatch(match); } // Pangea#