diff --git a/lib/screen/new_onboarding_page.dart b/lib/screen/new_onboarding_page.dart index f73b3c9b2..ea411a9db 100644 --- a/lib/screen/new_onboarding_page.dart +++ b/lib/screen/new_onboarding_page.dart @@ -207,8 +207,9 @@ class _NewOnboardingPageState extends State { price: _getEssentialPrice(subscriptionDetails), isProcessing: _selectedMembershipCardType == MembershipCardType.essential && - subscriptionDetails?.status == - IAPProductStatus.pending, + (subscriptionDetails?.status == + IAPProductStatus.pending || + subscriptionState.isProcessing), isEnable: true, onTap: (type) { _selectMembershipType(type); @@ -221,8 +222,9 @@ class _NewOnboardingPageState extends State { price: _getPremiumPrice(subscriptionDetails), isProcessing: _selectedMembershipCardType == MembershipCardType.premium && - subscriptionDetails?.status == - IAPProductStatus.pending, + (subscriptionDetails?.status == + IAPProductStatus.pending || + subscriptionState.isProcessing), isEnable: true, onTap: (type) async { _selectMembershipType(type); diff --git a/lib/screen/settings/subscription/subscription_page.dart b/lib/screen/settings/subscription/subscription_page.dart index d324cad42..06ef1e8d2 100644 --- a/lib/screen/settings/subscription/subscription_page.dart +++ b/lib/screen/settings/subscription/subscription_page.dart @@ -70,8 +70,12 @@ class _SubscriptionPageState extends State onIndexChanged: (index) {}, index: initialIndex, loop: false, - itemBuilder: (context, index) => _subcribeView( - context, subscriptionDetails[index], subscriptionStatus), + itemBuilder: (context, index) => _subscribeView( + context, + subscriptionDetails[index], + subscriptionStatus, + state.isProcessing, + ), pagination: subscriptionDetails.length > 1 ? const SwiperPagination( builder: DotSwiperPaginationBuilder( @@ -86,10 +90,12 @@ class _SubscriptionPageState extends State ); } - Widget _subcribeView( - BuildContext context, - SubscriptionDetails subscriptionDetails, - SubscriptionStatus? subscriptionStatus) => + Widget _subscribeView( + BuildContext context, + SubscriptionDetails subscriptionDetails, + SubscriptionStatus? subscriptionStatus, + bool? isProcessing, + ) => Container( color: AppColor.auGreyBackground, padding: const EdgeInsets.all(3), @@ -110,7 +116,11 @@ class _SubscriptionPageState extends State padding: ResponsiveLayout.pageHorizontalEdgeInsetsWithSubmitButton, child: _actionSection( - context, subscriptionDetails, subscriptionStatus), + context, + subscriptionDetails, + subscriptionStatus, + isProcessing, + ), ), ], ), @@ -201,6 +211,7 @@ class _SubscriptionPageState extends State BuildContext context, SubscriptionDetails subscriptionDetails, SubscriptionStatus? subscriptionStatus, + bool? isProcessing, ) { final theme = Theme.of(context); final dateFormater = DateFormat('dd/MM/yyyy'); @@ -305,7 +316,8 @@ class _SubscriptionPageState extends State return MembershipCard( type: MembershipCardType.premium, price: subscriptionDetails.price, - isProcessing: subscriptionDetails.status == IAPProductStatus.pending, + isProcessing: isProcessing == true || + subscriptionDetails.status == IAPProductStatus.pending, isEnable: true, onTap: (_) { _onPressSubscribe(context, diff --git a/lib/view/cast_button.dart b/lib/view/cast_button.dart index 79e7c517b..482479054 100644 --- a/lib/view/cast_button.dart +++ b/lib/view/cast_button.dart @@ -175,7 +175,8 @@ class _FFCastButtonState extends State { return MembershipCard( type: MembershipCardType.premium, price: price, - isProcessing: upgradeState.isProcessing, + isProcessing: upgradeState.isProcessing || + subscriptionDetail?.status == IAPProductStatus.pending, isEnable: subscriptionDetail != null, onTap: (_) { _onPressSubscribe(subscriptionDetails: subscriptionDetail!);