From 2f4b3eb9c7b1929305adac870cc399b8aea7b876 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Mon, 16 Sep 2024 09:59:14 +0200 Subject: [PATCH] [Oztechan/CCC#3948] Replace restartApp logic with recreate() (#3949) --- .../ui/mobile/content/premium/PremiumBottomSheet.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/content/premium/PremiumBottomSheet.kt b/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/content/premium/PremiumBottomSheet.kt index fd003dc6af..54600d15f9 100644 --- a/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/content/premium/PremiumBottomSheet.kt +++ b/android/ui/mobile/src/main/kotlin/com/oztechan/ccc/android/ui/mobile/content/premium/PremiumBottomSheet.kt @@ -16,7 +16,6 @@ import com.oztechan.ccc.android.core.billing.BillingManager import com.oztechan.ccc.android.ui.mobile.BuildConfig import com.oztechan.ccc.android.ui.mobile.R import com.oztechan.ccc.android.ui.mobile.databinding.BottomSheetPremiumBinding -import com.oztechan.ccc.android.ui.mobile.util.resolveAndStartIntent import com.oztechan.ccc.android.ui.mobile.util.showDialog import com.oztechan.ccc.android.ui.mobile.util.showSnack import com.oztechan.ccc.android.ui.mobile.util.toOldPurchaseList @@ -108,10 +107,11 @@ class PremiumBottomSheet : BaseVBBottomSheetDialogFragment billingManager.consumePurchase(viewEffect.token) } }.launchIn(viewLifecycleOwner.lifecycleScope) @@ -121,7 +121,7 @@ class PremiumBottomSheet : BaseVBBottomSheetDialogFragment Logger.i { "PremiumBottomSheet observeBillingEffects ${viewEffect::class.simpleName}" } when (viewEffect) { - BillingEffect.SuccessfulPurchase -> restartActivity() + BillingEffect.SuccessfulPurchase -> requireActivity().recreate() is BillingEffect.RestoreOrConsumePurchase -> viewModel.event.onRestoreOrConsumePurchase( viewEffect.purchaseList.toOldPurchaseList() ) @@ -155,9 +155,4 @@ class PremiumBottomSheet : BaseVBBottomSheetDialogFragment