Updated on 2026-08-14
This commit is contained in:
parent
adce32116c
commit
02d07a4e29
3 changed files with 42 additions and 6 deletions
|
|
@ -9,8 +9,8 @@ import com.tangem.tap.common.redux.AppState
|
|||
import com.tangem.tap.common.redux.appReducer
|
||||
import com.tangem.tap.common.redux.global.GlobalAction
|
||||
import com.tangem.tap.domain.config.ConfigManager
|
||||
import com.tangem.tap.domain.config.LocalLoader
|
||||
import com.tangem.tap.domain.config.RemoteLoader
|
||||
import com.tangem.tap.domain.config.FeaturesLocalLoader
|
||||
import com.tangem.tap.domain.config.FeaturesRemoteLoader
|
||||
import com.tangem.tap.network.NetworkConnectivity
|
||||
import com.tangem.tap.network.createMoshi
|
||||
import com.tangem.tap.persistence.PreferencesStorage
|
||||
|
|
@ -50,8 +50,8 @@ class TapApplication : Application() {
|
|||
|
||||
private fun loadConfigs() {
|
||||
val moshi = createMoshi()
|
||||
val localLoader = LocalLoader(this, moshi)
|
||||
val remoteLoader = RemoteLoader(moshi)
|
||||
val localLoader = FeaturesLocalLoader(this, moshi)
|
||||
val remoteLoader = FeaturesRemoteLoader(moshi)
|
||||
val configManager = ConfigManager(localLoader, remoteLoader)
|
||||
configManager.load { store.dispatch(GlobalAction.SetConfigManager(configManager)) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ interface ConfigLoader {
|
|||
}
|
||||
|
||||
|
||||
class LocalLoader(
|
||||
class FeaturesLocalLoader(
|
||||
private val context: Context,
|
||||
private val moshi: Moshi
|
||||
) : ConfigLoader {
|
||||
|
|
@ -48,7 +48,7 @@ class LocalLoader(
|
|||
}
|
||||
}
|
||||
|
||||
class RemoteLoader(
|
||||
class FeaturesRemoteLoader(
|
||||
private val moshi: Moshi
|
||||
) : ConfigLoader {
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.tangem.tap.domain.remoteWarning
|
||||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
data class RemoteWarning(
|
||||
val title: String,
|
||||
val message: String,
|
||||
val type: Warning.Type,
|
||||
val priority: Warning.Priority,
|
||||
val location: List<Warning.Location>,
|
||||
val blockchains: List<Blockchain>,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
sealed class Warning {
|
||||
enum class Priority(val priority: String) {
|
||||
Info("info"),
|
||||
Warning("warning"),
|
||||
Critical("critical")
|
||||
}
|
||||
enum class Type(val type: String) {
|
||||
Permanent("permanent"), // нельзя скрыть
|
||||
Temporary("temporary") // можно скрыть (кнопка ОК)
|
||||
}
|
||||
|
||||
enum class Location(val location: String) {
|
||||
MainScreen("main"),
|
||||
SendScreen("send")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue