Updated on 2026-08-14
This commit is contained in:
parent
8f5db97d2f
commit
801a02506f
19 changed files with 255 additions and 338 deletions
|
|
@ -16,7 +16,6 @@ import com.tangem.datasource.api.common.MoshiConverter
|
|||
import com.tangem.datasource.api.common.createNetworkLoggingInterceptor
|
||||
import com.tangem.datasource.asset.loader.AssetLoader
|
||||
import com.tangem.datasource.config.ConfigManager
|
||||
import com.tangem.datasource.config.FeaturesLocalLoader
|
||||
import com.tangem.datasource.config.models.Config
|
||||
import com.tangem.datasource.connection.NetworkConnectionManager
|
||||
import com.tangem.datasource.local.preferences.AppPreferencesStore
|
||||
|
|
@ -202,10 +201,11 @@ abstract class TangemApplication : Application(), ImageLoaderFactory {
|
|||
// [REDACTED_JIRA]
|
||||
runBlocking {
|
||||
featureTogglesManager.init()
|
||||
initConfigManager(
|
||||
loader = FeaturesLocalLoader(assetLoader, BuildConfig.ENVIRONMENT),
|
||||
onComplete = ::initWithConfigDependency,
|
||||
)
|
||||
|
||||
val config = configManager.initialize()
|
||||
store.dispatch(GlobalAction.SetConfigManager(configManager))
|
||||
|
||||
initWithConfigDependency(config = config)
|
||||
}
|
||||
|
||||
loadNativeLibraries()
|
||||
|
|
@ -223,7 +223,7 @@ abstract class TangemApplication : Application(), ImageLoaderFactory {
|
|||
)
|
||||
appStateHolder.mainStore = store
|
||||
|
||||
walletConnect2Repository.init(projectId = configManager.config.walletConnectProjectId)
|
||||
walletConnect2Repository.init(projectId = configManager.getConfigSync().walletConnectProjectId)
|
||||
}
|
||||
|
||||
private fun createReduxStore(): Store<AppState> {
|
||||
|
|
@ -278,13 +278,6 @@ abstract class TangemApplication : Application(), ImageLoaderFactory {
|
|||
System.loadLibrary("TrustWalletCore")
|
||||
}
|
||||
|
||||
private suspend fun initConfigManager(loader: FeaturesLocalLoader, onComplete: (Config) -> Unit) {
|
||||
configManager.load(loader) { config ->
|
||||
store.dispatch(GlobalAction.SetConfigManager(configManager))
|
||||
onComplete(config)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initWithConfigDependency(config: Config) {
|
||||
initAnalytics(this, config)
|
||||
Log.addLogger(logger = tangemSdkLogger)
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ private fun handleAction(action: Action, appState: () -> AppState?) {
|
|||
}
|
||||
is GlobalAction.ExchangeManager.Init -> {
|
||||
val appStateSafe = appState() ?: return
|
||||
val config = appStateSafe.globalState.configManager?.config ?: return
|
||||
val config = appStateSafe.globalState.configManager?.getConfigSync() ?: return
|
||||
|
||||
scope.launch {
|
||||
val scanResponseProvider: () -> ScanResponse? = {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ internal class DefaultStakeKitAuthProvider(
|
|||
) : StakeKitAuthProvider {
|
||||
|
||||
override fun getApiKey(): String {
|
||||
return configManager.config.stakeKitApiKey ?: error("No StakeKit api key provided")
|
||||
return configManager.getConfigSync().stakeKitApiKey ?: error("No StakeKit api key provided")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue