File tree Expand file tree Collapse file tree
androidMain/kotlin/site/remlit/snowdrop/util/cache
commonMain/kotlin/site/remlit/snowdrop/util/cache
iosMain/kotlin/site/remlit/snowdrop/util/cache Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- package site.remlit.snowdrop.util
1+ package site.remlit.snowdrop.util.cache
22
33import android.content.Context
44import com.russhwolf.settings.ExperimentalSettingsApi
55import com.russhwolf.settings.SharedPreferencesSettings
66import com.russhwolf.settings.coroutines.FlowSettings
77import com.russhwolf.settings.coroutines.toFlowSettings
8+ import site.remlit.snowdrop.util.AndroidContext
89
910
1011@OptIn(ExperimentalSettingsApi ::class )
Original file line number Diff line number Diff line change @@ -20,5 +20,7 @@ fun fetchAccount(id: String): Flow<Account> = object : Flow<Account> {
2020 val req = getAccount(id)
2121 if (! req.error && req.response != null )
2222 collector.emit(req.response)
23+
24+ putCacheEntry(" account_$id " , req.response)
2325 }
2426}
Original file line number Diff line number Diff line change 1- package site.remlit.snowdrop.util
1+ package site.remlit.snowdrop.util.cache
22
33import com.russhwolf.settings.ExperimentalSettingsApi
44import com.russhwolf.settings.NSUserDefaultsSettings
You can’t perform that action at this time.
0 commit comments