Updated on 2026-08-14
This commit is contained in:
parent
9bd372d0af
commit
5ec38a0d61
23 changed files with 424 additions and 162 deletions
|
|
@ -29,7 +29,7 @@ class DefaultKycComponent @AssistedInject constructor(
|
|||
.withAccessToken(accessToken = startInfo.token, onTokenExpiration = tokenExpirationHandler)
|
||||
.withTheme(TangemSNSTheme.theme(activity))
|
||||
.withIconHandler(TangemSNSIconHandler())
|
||||
.withLocale(Locale("en"))
|
||||
.withLocale(Locale(startInfo.locale))
|
||||
.build()
|
||||
snsSdk.launch()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import androidx.compose.runtime.Stable
|
|||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.decompose.model.Model
|
||||
import com.tangem.domain.pay.KycStartInfo
|
||||
import com.tangem.domain.pay.usecase.KycStartInfoUseCase
|
||||
import com.tangem.domain.pay.repository.KycRepository
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
|
|
@ -15,7 +15,7 @@ import javax.inject.Inject
|
|||
@ModelScoped
|
||||
class DefaultKycModel @Inject constructor(
|
||||
override val dispatchers: CoroutineDispatcherProvider,
|
||||
private val kycStartInfoUseCase: KycStartInfoUseCase,
|
||||
private val kycRepository: KycRepository,
|
||||
) : Model() {
|
||||
|
||||
private val _uiState: MutableStateFlow<KycStartInfo?> = MutableStateFlow(null)
|
||||
|
|
@ -23,7 +23,7 @@ class DefaultKycModel @Inject constructor(
|
|||
|
||||
fun getKycToken() {
|
||||
modelScope.launch {
|
||||
kycStartInfoUseCase().getOrNull()?.let { _uiState.emit(it) }
|
||||
kycRepository.getKycStartInfo().getOrNull()?.let { _uiState.emit(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ import dagger.assisted.AssistedInject
|
|||
/**
|
||||
* Mocking it for release/external builds to exclude SumSub dependency
|
||||
*/
|
||||
class MockKycComponent @AssistedInject constructor(
|
||||
internal class MockKycComponent @AssistedInject constructor(
|
||||
@Assisted appComponentContext: AppComponentContext,
|
||||
) : KycComponent, AppComponentContext by appComponentContext {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue