Commit 8709575e authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Merge branch 'develop-2.x' of...

Merge branch 'develop-2.x' of https://github.com/RocketChat/Rocket.Chat.Android into improvement/layout
parents 93f77eb2 6c82cf20
...@@ -6,16 +6,16 @@ import chat.rocket.android.server.domain.SettingsRepository ...@@ -6,16 +6,16 @@ import chat.rocket.android.server.domain.SettingsRepository
import chat.rocket.core.internal.SettingsAdapter import chat.rocket.core.internal.SettingsAdapter
import chat.rocket.core.model.Value import chat.rocket.core.model.Value
class SharedPreferencesSettingsRepository(private val localRespository: LocalRepository) : SettingsRepository { class SharedPreferencesSettingsRepository(private val localRepository: LocalRepository) : SettingsRepository {
private val adapter = SettingsAdapter() private val adapter = SettingsAdapter().lenient()
override fun save(url: String, settings: Map<String, Value<Any>>) { override fun save(url: String, settings: Map<String, Value<Any>>) {
localRespository.save("$SETTINGS_KEY$url", adapter.toJson(settings)) localRepository.save("$SETTINGS_KEY$url", adapter.toJson(settings))
} }
override fun get(url: String): Map<String, Value<Any>>? { override fun get(url: String): Map<String, Value<Any>>? {
val settings = localRespository.get("$SETTINGS_KEY$url") val settings = localRepository.get("$SETTINGS_KEY$url")
settings?.let { settings?.let {
return adapter.fromJson(it) return adapter.fromJson(it)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment