remove more duplicate logic

This commit is contained in:
ggurdin 2025-11-05 10:40:23 -05:00
parent a4b8f2b8bc
commit 2bc8a10e5c
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
2 changed files with 10 additions and 27 deletions

View file

@ -1765,17 +1765,7 @@ class ChatController extends State<ChatPageWithRoom>
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#

View file

@ -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#