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

Remove skip subscription stage

parent 3be0745b
No related branches found
No related tags found
No related merge requests found
......@@ -49,31 +49,13 @@ class SignUpDataSource @Inject constructor(
suspend fun startSignUpStages(
stages: List<Stage>,
serverDomain: String,
subscriptionReceiptData: SubscriptionReceiptData?
serverDomain: String
) {
currentStage = null
stagesToComplete.clear()
domain = serverDomain
stagesToComplete.addAll(stages)
subscriptionReceiptData?.let { skipSubscriptionStageIfValid(it) } ?: navigateToNextStage()
}
private suspend fun skipSubscriptionStageIfValid(subscriptionReceiptData: SubscriptionReceiptData) {
setNextStage()
(currentStage as? Stage.Other)?.takeIf {
it.type == REGISTRATION_SUBSCRIPTION_TYPE
} ?: run {
currentStage = null
navigateToNextStage()
return
}
val response = subscriptionStageDataSource.validateSubscription(subscriptionReceiptData)
if (response is Response.Error) {
currentStage = null
navigateToNextStage()
}
navigateToNextStage()
}
suspend fun performRegistrationStage(
......
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