diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/ComponentPlatformApi.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/ComponentPlatformApi.kt index 71cfc2f4..8b783f8e 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/ComponentPlatformApi.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/ComponentPlatformApi.kt @@ -122,7 +122,6 @@ class ComponentPlatformApi( currentComponent = null googlePayComponentManager.onDispose(componentId) instantComponentManager.onDispose(componentId) - actionComponentManager.onDispose(componentId) } fun handleActivityResult( diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/action/ActionComponentManager.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/action/ActionComponentManager.kt index e901ee90..ac4b4a4f 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/action/ActionComponentManager.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/action/ActionComponentManager.kt @@ -19,9 +19,6 @@ internal class ActionComponentManager( private val componentFlutterApi: ComponentFlutterInterface, private val assignCurrentComponent: (ActionHandlingComponent?) -> Unit, ) { - private var componentId: String? = null - private var actionComponent: GenericActionComponent? = null - fun handleAction( actionComponentConfigurationDTO: ActionComponentConfigurationDTO, componentId: String, @@ -37,7 +34,6 @@ internal class ActionComponentManager( val actionComponent = createActionComponent(checkoutConfiguration, componentId) val action = Action.SERIALIZER.deserialize(JSONObject(actionResponse)) if (actionComponent.canHandleAction(action)) { - this.componentId = componentId assignCurrentComponent(actionComponent) ComponentLoadingBottomSheet.show(activity.supportFragmentManager, actionComponent) actionComponent.handleAction(action, activity) @@ -49,13 +45,6 @@ internal class ActionComponentManager( } } - fun onDispose(componentId: String) { - if (componentId == this.componentId) { - actionComponent = null - this.componentId = null - } - } - private fun createActionComponent( checkoutConfiguration: CheckoutConfiguration, componentId: String diff --git a/android/src/main/kotlin/com/adyen/checkout/flutter/components/view/ComponentLoadingBottomSheet.kt b/android/src/main/kotlin/com/adyen/checkout/flutter/components/view/ComponentLoadingBottomSheet.kt index 3a8ff0e2..eb21c9ba 100644 --- a/android/src/main/kotlin/com/adyen/checkout/flutter/components/view/ComponentLoadingBottomSheet.kt +++ b/android/src/main/kotlin/com/adyen/checkout/flutter/components/view/ComponentLoadingBottomSheet.kt @@ -5,7 +5,6 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.FragmentManager -import com.adyen.checkout.action.core.GenericActionComponent import com.adyen.checkout.components.core.internal.Component import com.adyen.checkout.flutter.R import com.adyen.checkout.ui.core.AdyenComponentView @@ -24,7 +23,7 @@ internal class ComponentLoadingBottomSheet : BottomSheetDialogFragment() wher view: View, savedInstanceState: Bundle? ) { - //We need to cast the component because it has two types T (ViewableComponent and Component) + // We need to cast the component because it has two types T (ViewableComponent and Component) (component as? T)?.let { view.findViewById(R.id.adyen_component_view)?.attach(it, viewLifecycleOwner) isCancelable = false