diff --git a/auth/src/main/java/org/futo/circles/auth/feature/uia/UIADataSourceProvider.kt b/auth/src/main/java/org/futo/circles/auth/feature/uia/UIADataSourceProvider.kt index 1471183a5a5440df0f238434b7bf2b3f36766bb3..2f8aeebf322290131e9951710da25ffca56e8ce5 100644 --- a/auth/src/main/java/org/futo/circles/auth/feature/uia/UIADataSourceProvider.kt +++ b/auth/src/main/java/org/futo/circles/auth/feature/uia/UIADataSourceProvider.kt @@ -18,4 +18,9 @@ object UIADataSourceProvider { activeFlowType = flowType return factory.create(flowType).also { activeFlowDataSource = it } } + + fun clear() { + activeFlowType = null + activeFlowDataSource = null + } } diff --git a/auth/src/main/java/org/futo/circles/auth/feature/uia/UIADialogFragment.kt b/auth/src/main/java/org/futo/circles/auth/feature/uia/UIADialogFragment.kt index 84a36759e06cb9ffcbf1aecb7fec75c96a8d032a..649b6f6ed3f7faa80dea46593cfc59bd93d40783 100644 --- a/auth/src/main/java/org/futo/circles/auth/feature/uia/UIADialogFragment.kt +++ b/auth/src/main/java/org/futo/circles/auth/feature/uia/UIADialogFragment.kt @@ -1,6 +1,7 @@ package org.futo.circles.auth.feature.uia import android.app.Dialog +import android.content.DialogInterface import android.net.Uri import android.os.Bundle import android.view.View @@ -69,6 +70,11 @@ class UIADialogFragment : setupObservers() } + override fun onDismiss(dialog: DialogInterface) { + super.onDismiss(dialog) + UIADataSourceProvider.clear() + } + private fun setupViews() { binding.toolbar.apply { title = getString( @@ -110,7 +116,7 @@ class UIADialogFragment : when (UIADataSourceProvider.activeFlowType) { UIAFlowType.Login -> viewModel.finishLogin(it) UIAFlowType.Signup -> viewModel.finishSignup(it) - UIAFlowType.ForgotPassword->viewModel.finishForgotPassword(it) + UIAFlowType.ForgotPassword -> viewModel.finishForgotPassword(it) else -> dismiss() } }