From ba93d0ad9d093acd67598cec279175e86f792edf Mon Sep 17 00:00:00 2001 From: Olof Hedman Date: Tue, 16 Sep 2025 13:38:36 +0200 Subject: [PATCH] Use kotlin platform independent time instead of jvm System --- shared/src/commonMain/kotlin/app/klottr/nearby/AutoScan.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/src/commonMain/kotlin/app/klottr/nearby/AutoScan.kt b/shared/src/commonMain/kotlin/app/klottr/nearby/AutoScan.kt index e674ad0..38c8c97 100644 --- a/shared/src/commonMain/kotlin/app/klottr/nearby/AutoScan.kt +++ b/shared/src/commonMain/kotlin/app/klottr/nearby/AutoScan.kt @@ -8,6 +8,8 @@ import app.klottr.util.distanceMeters import kotlinx.coroutines.async import kotlinx.coroutines.coroutineScope import kotlin.math.roundToInt +import kotlin.time.Clock +import kotlin.time.ExperimentalTime /** Konfiguration för autoscan (toggles + radier). */ data class ScanConfig( @@ -36,7 +38,8 @@ suspend fun scanAndMarkFound( ): Boolean = coroutineScope { updateAwayFlags(lat, lon) - val now = System.currentTimeMillis() + @OptIn(ExperimentalTime::class) + val now: Long = Clock.System.now().toEpochMilliseconds() val wikiDef = async { if (!config.showWiki) emptyList()