fix: bump kotlinx-datetime to 0.7.1, scope ExperimentalTime opt-in to saveEvents
This commit is contained in:
@@ -7,7 +7,6 @@ import kotlin.time.ExperimentalTime
|
|||||||
import kotlinx.serialization.builtins.ListSerializer
|
import kotlinx.serialization.builtins.ListSerializer
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
|
||||||
@OptIn(ExperimentalTime::class)
|
|
||||||
class ScheduleCache(private val settings: Settings) {
|
class ScheduleCache(private val settings: Settings) {
|
||||||
|
|
||||||
private val json = Json { ignoreUnknownKeys = true }
|
private val json = Json { ignoreUnknownKeys = true }
|
||||||
@@ -19,6 +18,7 @@ class ScheduleCache(private val settings: Settings) {
|
|||||||
private fun typeFilterKey(account: String) = "filters_typefilter_$account"
|
private fun typeFilterKey(account: String) = "filters_typefilter_$account"
|
||||||
private fun timestampKey(account: String) = "cached_events_timestamp_$account"
|
private fun timestampKey(account: String) = "cached_events_timestamp_$account"
|
||||||
|
|
||||||
|
@OptIn(ExperimentalTime::class)
|
||||||
fun saveEvents(account: String, events: List<Event>) {
|
fun saveEvents(account: String, events: List<Event>) {
|
||||||
settings.putString(eventsKey(account), json.encodeToString(eventListSerializer, events))
|
settings.putString(eventsKey(account), json.encodeToString(eventListSerializer, events))
|
||||||
settings.putLong(timestampKey(account), Clock.System.now().toEpochMilliseconds())
|
settings.putLong(timestampKey(account), Clock.System.now().toEpochMilliseconds())
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ agp = "8.13.2"
|
|||||||
ktor = "3.5.1"
|
ktor = "3.5.1"
|
||||||
kotlinx-serialization-json = "1.11.0"
|
kotlinx-serialization-json = "1.11.0"
|
||||||
kotlinx-coroutines = "1.11.0"
|
kotlinx-coroutines = "1.11.0"
|
||||||
kotlinx-datetime = "0.7.0"
|
kotlinx-datetime = "0.7.1"
|
||||||
multiplatform-settings = "1.3.0"
|
multiplatform-settings = "1.3.0"
|
||||||
lifecycle-viewmodel-compose = "2.10.0"
|
lifecycle-viewmodel-compose = "2.10.0"
|
||||||
androidx-activity-compose = "1.13.0"
|
androidx-activity-compose = "1.13.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user