Updated on 2026-08-14
This commit is contained in:
parent
3723229539
commit
c6e06b1eb9
61 changed files with 132 additions and 139 deletions
|
|
@ -55,7 +55,7 @@ object PreferencesKeys {
|
|||
|
||||
val FEATURE_TOGGLES_KEY by lazy { stringPreferencesKey(name = "featureToggles") }
|
||||
|
||||
val EXCLUDED_BLOCKCHAINS_KEY by lazy { stringPreferencesKey(name = "excludedBlockchains") }
|
||||
val EXCLUDED_BLOCKCHAINS_KEY by lazy { stringSetPreferencesKey(name = "excludedBlockchains") }
|
||||
|
||||
val WAS_TWINS_ONBOARDING_SHOWN by lazy { booleanPreferencesKey(name = "twinsOnboardingShown") }
|
||||
|
||||
|
|
|
|||
|
|
@ -98,12 +98,6 @@ suspend inline fun <reified T> AppPreferencesStore.storeObjectList(key: Preferen
|
|||
edit { it[key] = adapter.toJson(value) }
|
||||
}
|
||||
|
||||
/** Store set of data [value] by string [key] */
|
||||
suspend inline fun <reified T> AppPreferencesStore.storeObjectSet(key: Preferences.Key<String>, value: Set<T>) {
|
||||
val adapter = moshi.adapter<Set<T>>(Types.newParameterizedType(Set::class.java, T::class.java))
|
||||
edit { it[key] = adapter.toJson(value) }
|
||||
}
|
||||
|
||||
/** Get flow of list of data [T] by string [key]. If data is not found, it returns `null` */
|
||||
inline fun <reified T> AppPreferencesStore.getObjectList(key: Preferences.Key<String>): Flow<List<T>?> {
|
||||
val adapter = moshi.adapter<List<T>>(Types.newParameterizedType(List::class.java, T::class.java))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue