From 317cf88aca3533f86a27e445c6c0d389d00fd4e0 Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:39:36 -0500 Subject: [PATCH] fix: if user is unsubscribed, and shouldn't show paywall, send message without running IGC (#1344) --- .../controllers/choreographer.dart | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/pangea/choreographer/controllers/choreographer.dart b/lib/pangea/choreographer/controllers/choreographer.dart index b65e261a2..b74c95d03 100644 --- a/lib/pangea/choreographer/controllers/choreographer.dart +++ b/lib/pangea/choreographer/controllers/choreographer.dart @@ -87,17 +87,21 @@ class Choreographer { return; } - if (pangeaController.subscriptionController.subscriptionStatus == - SubscriptionStatus.showPaywall) { - OverlayUtil.showPositionedCard( - context: context, - cardToShow: PaywallCard( - chatController: chatController, - ), - maxHeight: 325, - maxWidth: 325, - transformTargetId: inputTransformTargetKey, - ); + if (!pangeaController.subscriptionController.isSubscribed) { + // don't want to run IGC if user isn't subscribed, so either + // show the paywall if applicable or just send the message + final status = pangeaController.subscriptionController.subscriptionStatus; + status == SubscriptionStatus.showPaywall + ? OverlayUtil.showPositionedCard( + context: context, + cardToShow: PaywallCard( + chatController: chatController, + ), + maxHeight: 325, + maxWidth: 325, + transformTargetId: inputTransformTargetKey, + ) + : chatController.send(); return; }