refactor: modern APIs — Koin 4.2, CMP 1.11, Ktor resilience, Room @Upsert, injected dispatchers (#5119)

This commit is contained in:
James Rich 2026-04-14 06:41:01 -05:00 committed by GitHub
parent 99378c9291
commit 9acdf5309f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 453 additions and 278 deletions

View file

@ -27,17 +27,18 @@ import androidx.compose.runtime.mutableLongStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalContext
import org.meshtastic.core.common.util.nowMillis
@Composable
actual fun rememberTimeTickWithLifecycle(): Long {
val context = LocalContext.current
var value by remember { mutableLongStateOf(System.currentTimeMillis()) }
var value by remember { mutableLongStateOf(nowMillis) }
DisposableEffect(context) {
val receiver =
object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
value = System.currentTimeMillis()
value = nowMillis
}
}

View file

@ -17,6 +17,7 @@
package org.meshtastic.core.ui.component
import androidx.compose.runtime.Composable
import org.meshtastic.core.common.util.nowMillis
/** JVM implementation — returns System.currentTimeMillis() (no lifecycle-based updates on Desktop). */
@Composable actual fun rememberTimeTickWithLifecycle(): Long = System.currentTimeMillis()
/** JVM implementation — returns the current epoch millis (no lifecycle-based updates on Desktop). */
@Composable actual fun rememberTimeTickWithLifecycle(): Long = nowMillis