File tree Expand file tree Collapse file tree
app/src/main/java/com/tangem/tap/data Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import com.tangem.sdk.nfc.NfcManager
2929import com.tangem.sdk.storage.create
3030import com.tangem.tap.foregroundActivityObserver
3131import com.tangem.utils.coroutines.CoroutineDispatcherProvider
32+ import com.tangem.wallet.BuildConfig
3233import kotlinx.coroutines.CoroutineScope
3334import kotlinx.coroutines.SupervisorJob
3435import kotlinx.coroutines.flow.launchIn
@@ -60,14 +61,25 @@ internal class DefaultCardSdkProvider @Inject constructor(
6061 get() = holder?.sdk ? : tryToRegisterWithForegroundActivity()
6162
6263 init {
63- appPreferencesStore.getObjectMap<ApiEnvironment >(PreferencesKeys .apiConfigsEnvironmentKey)
64- .map { it[ApiConfig .ID .TangemCardSdk .name] == ApiEnvironment .PROD }
65- .onEach { isProd ->
66- holder?.let {
67- it.sdk.config.isTangemAttestationProdEnv = isProd
64+ if (BuildConfig .TESTER_MENU_ENABLED ) {
65+ appPreferencesStore.getObjectMap<ApiEnvironment >(PreferencesKeys .apiConfigsEnvironmentKey)
66+ .map {
67+ when (it[ApiConfig .ID .TangemCardSdk .name]) {
68+ ApiEnvironment .DEV ,
69+ ApiEnvironment .STAGE ,
70+ -> false
71+ ApiEnvironment .PROD ,
72+ null ,
73+ -> true
74+ }
6875 }
69- }
70- .launchIn(CoroutineScope (SupervisorJob () + dispatchers.main))
76+ .onEach { isProd ->
77+ holder?.let {
78+ it.sdk.config.isTangemAttestationProdEnv = isProd
79+ }
80+ }
81+ .launchIn(CoroutineScope (SupervisorJob () + dispatchers.main))
82+ }
7183 }
7284
7385 override fun register (activity : FragmentActivity ) = runBlocking(dispatchers.mainImmediate) {
You can’t perform that action at this time.
0 commit comments