Skip to content

Commit

Permalink
fix: if user is unsubscribed, and shouldn't show paywall, send messag…
Browse files Browse the repository at this point in the history
…e without running IGC (#1344)
  • Loading branch information
ggurdin authored Jan 2, 2025
1 parent f4e9823 commit 317cf88
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions lib/pangea/choreographer/controllers/choreographer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 317cf88

Please sign in to comment.