Skip to content
Snippets Groups Projects
Commit c7c03dfc authored by Taras's avatar Taras
Browse files

Change main scope to session scope

parent 7c4422ca
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,8 @@ import org.futo.circles.auth.feature.uia.UIADataSource ...@@ -7,6 +7,8 @@ import org.futo.circles.auth.feature.uia.UIADataSource
import org.futo.circles.auth.feature.uia.UIADataSourceProvider import org.futo.circles.auth.feature.uia.UIADataSourceProvider
import org.futo.circles.auth.model.UIAFlowType import org.futo.circles.auth.model.UIAFlowType
import org.futo.circles.core.base.SingleEventLiveData import org.futo.circles.core.base.SingleEventLiveData
import org.futo.circles.core.extensions.coroutineScope
import org.futo.circles.core.provider.MatrixSessionProvider
import org.matrix.android.sdk.api.auth.UIABaseAuth import org.matrix.android.sdk.api.auth.UIABaseAuth
import org.matrix.android.sdk.api.auth.UserInteractiveAuthInterceptor import org.matrix.android.sdk.api.auth.UserInteractiveAuthInterceptor
import org.matrix.android.sdk.api.auth.registration.RegistrationFlowResponse import org.matrix.android.sdk.api.auth.registration.RegistrationFlowResponse
...@@ -33,7 +35,7 @@ class AuthConfirmationProvider @Inject constructor( ...@@ -33,7 +35,7 @@ class AuthConfirmationProvider @Inject constructor(
if (flowResponse.completedStages.isNullOrEmpty()) { if (flowResponse.completedStages.isNullOrEmpty()) {
val stages = flowResponse.toFlowsWithStages().firstOrNull() ?: emptyList() val stages = flowResponse.toFlowsWithStages().firstOrNull() ?: emptyList()
startReAuthEventLiveData.postValue(Unit) startReAuthEventLiveData.postValue(Unit)
MainScope().launch(Dispatchers.IO) { MatrixSessionProvider.getSessionOrThrow().coroutineScope.launch(Dispatchers.IO) {
uiaDataSource.startUIAStages(stages, flowResponse.session ?: "", promise) uiaDataSource.startUIAStages(stages, flowResponse.session ?: "", promise)
} }
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment