fix: 电量显示

This commit is contained in:
HapeLee
2026-06-10 01:01:15 +08:00
parent 38bbe6f3ff
commit b27f068525
@@ -46,7 +46,6 @@ import io.legado.app.ui.replace.ReplaceEditRoute
import io.legado.app.ui.replace.ReplaceRuleActivity
import io.legado.app.utils.StartActivityContract
import io.legado.app.utils.takePersistablePermissionSafely
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.flow.onSubscription
import kotlinx.coroutines.launch
@@ -233,10 +232,9 @@ fun ReadBookRouteScreen(
// ── Effect collection: route handles launcher effects, rest goes to bridge ──
LaunchedEffect(viewModel) {
val effectsSubscribed = CompletableDeferred<Unit>()
launch {
viewModel.effects
.onSubscription { effectsSubscribed.complete(Unit) }
.onSubscription { onEffectsReady() }
.collect { effect ->
try {
when (effect) {
@@ -278,6 +276,7 @@ fun ReadBookRouteScreen(
putExtra("sourceOrigin", effect.sourceOrigin)
putExtra("sourceName", effect.sourceName)
effect.sourceType?.let { putExtra("sourceType", it) }
effect.html?.let { putExtra("html", it) }
}
)
}
@@ -363,8 +362,6 @@ fun ReadBookRouteScreen(
}
}
}
effectsSubscribed.await()
onEffectsReady()
}
// ── System UI sync ────────────────────────────────────────────────