diff --git a/app/src/main/assets/features_dev.json b/app/src/main/assets/features_dev.json index e932f5787b..33cf6e331b 100644 --- a/app/src/main/assets/features_dev.json +++ b/app/src/main/assets/features_dev.json @@ -1,10 +1,10 @@ [ { - "name": "isPayIdCreationEnabled", - "value": false + "name": "isWalletPayIdEnabled", + "value": true }, { "name": "isTopUpEnabled", - "value": false + "value": true } ] \ No newline at end of file diff --git a/app/src/main/assets/features_prod.json b/app/src/main/assets/features_prod.json index e932f5787b..ede61eb088 100644 --- a/app/src/main/assets/features_prod.json +++ b/app/src/main/assets/features_prod.json @@ -1,6 +1,6 @@ [ { - "name": "isPayIdCreationEnabled", + "name": "isWalletPayIdEnabled", "value": false }, { diff --git a/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt b/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt index 80b4bd5719..3713c72808 100644 --- a/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt @@ -86,9 +86,9 @@ class TapWalletManager { } tapWorkarounds = TapWorkarounds(data.card) if (tapWorkarounds!!.isStart2Coin) { - store.state.globalState.configManager?.turnOf(ConfigManager.isPayIdCreationEnabled) + store.state.globalState.configManager?.turnOf(ConfigManager.isWalletPayIdEnabled) } else { - store.state.globalState.configManager?.resetToDefault(ConfigManager.isPayIdCreationEnabled) + store.state.globalState.configManager?.resetToDefault(ConfigManager.isWalletPayIdEnabled) } withContext(Dispatchers.Main) { store.dispatch(WalletAction.ResetState) @@ -158,7 +158,7 @@ class TapWalletManager { private suspend fun loadPayIdIfNeeded(): Result? { val scanNoteResponse = store.state.globalState.scanNoteResponse - if (store.state.globalState.configManager?.config?.isPayIdCreationEnabled == false + if (store.state.globalState.configManager?.config?.isWalletPayIdEnabled == false || scanNoteResponse?.walletManager?.wallet?.blockchain?.isPayIdSupported() == false) { return null } @@ -175,7 +175,7 @@ class TapWalletManager { when (result) { is Result.Success -> { val config = store.state.globalState.configManager?.config - if (config?.isPayIdCreationEnabled == false) { + if (config?.isWalletPayIdEnabled == false) { store.dispatch(WalletAction.DisablePayId) return@withContext } diff --git a/app/src/main/java/com/tangem/tap/domain/config/ConfigManager.kt b/app/src/main/java/com/tangem/tap/domain/config/ConfigManager.kt index b9b05b49fe..668339cd20 100644 --- a/app/src/main/java/com/tangem/tap/domain/config/ConfigManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/config/ConfigManager.kt @@ -9,7 +9,7 @@ data class Config( val coinMarketCapKey: String = "f6622117-c043-47a0-8975-9d673ce484de", val moonPayApiKey: String = "pk_test_kc90oYTANy7UQdBavDKGfL4K9l6VEPE", val moonPayApiSecretKey: String = "sk_test_V8w4M19LbDjjYOt170s0tGuvXAgyEb1C", - val isPayIdCreationEnabled: Boolean = true, + val isWalletPayIdEnabled: Boolean = true, val isTopUpEnabled: Boolean = false, ) @@ -36,14 +36,14 @@ class ConfigManager( fun turnOf(name: String) { when (name) { - isPayIdCreationEnabled -> config = config.copy(isPayIdCreationEnabled = false) + isWalletPayIdEnabled -> config = config.copy(isWalletPayIdEnabled = false) isTopUpEnabled -> config = config.copy(isTopUpEnabled = false) } } fun resetToDefault(name: String) { when (name) { - isPayIdCreationEnabled -> config = config.copy(isPayIdCreationEnabled = defaultConfig.isPayIdCreationEnabled) + isWalletPayIdEnabled -> config = config.copy(isWalletPayIdEnabled = defaultConfig.isWalletPayIdEnabled) isTopUpEnabled -> config = config.copy(isTopUpEnabled = defaultConfig.isTopUpEnabled) } } @@ -52,9 +52,9 @@ class ConfigManager( val newValue = value ?: return when (name) { - isPayIdCreationEnabled -> { - config = config.copy(isPayIdCreationEnabled = newValue) - defaultConfig = defaultConfig.copy(isPayIdCreationEnabled = newValue) + isWalletPayIdEnabled -> { + config = config.copy(isWalletPayIdEnabled = newValue) + defaultConfig = defaultConfig.copy(isWalletPayIdEnabled = newValue) } isTopUpEnabled -> { config = config.copy(isTopUpEnabled = newValue) @@ -81,7 +81,7 @@ class ConfigManager( } companion object { - const val isPayIdCreationEnabled = "isPayIdCreationEnabled" + const val isWalletPayIdEnabled = "isWalletPayIdEnabled" const val isTopUpEnabled = "useTopUp" const val coinMarketCapKey = "coinMarketCapKey" const val moonPayApiKey = "moonPayApiKey"