diff --git a/lib/ui/subscription_page.dart b/lib/ui/subscription_page.dart index 282fc7faa..69612db46 100644 --- a/lib/ui/subscription_page.dart +++ b/lib/ui/subscription_page.dart @@ -74,7 +74,7 @@ class _SubscriptionPageState extends State { text = "your plan was successfully downgraded"; } showToast(text); - if (_hasActiveSubscription) { + if (_currentSubscription != null) { _currentSubscription = _billingService.getSubscription(); _hasActiveSubscription = _currentSubscription != null && _currentSubscription.isValid(); @@ -82,6 +82,7 @@ class _SubscriptionPageState extends State { } else { Navigator.of(context).popUntil((route) => route.isFirst); } + await _dialog.hide(); } catch (e) { _logger.warning("Could not complete payment ", e); await _dialog.hide(); @@ -95,9 +96,9 @@ class _SubscriptionPageState extends State { } } else if (Platform.isIOS && purchase.pendingCompletePurchase) { await InAppPurchaseConnection.instance.completePurchase(purchase); + await _dialog.hide(); } } - await _dialog.hide(); }); super.initState(); }