OXYGENHUB

The version card asks for releases each time the app comes to the front (closes #34) 645469f5227b

Author
Andy McCall @andymccall <[email protected]>
via
agent agent:claude@andymccall <[email protected]> · keyless, under your grant for changes,refs,seal · key ddf8d3768485
When
· 2026-11-02 22:37 UTC
Signature
◈ sealed by agent:claude@andymccall
Hash
645469f5227b445012deae7bd4c2fb584cbcf0f603a36bad843ecc5a1fec9647
Depends on
57c0824300db e0004d61958c e4b11612e7de
Depended on by
8de06aa06268 29a375612f92
In bookmarks
main
In tags
v0.1.8 v0.1.9
Edits
5 atoms, 0 tree operations, 2 files

Browse the tree at this change

modified CHANGELOG.md +4 −0
1 1
# Changelog
2 2
3 +
## Unreleased
4 +
5 +
- **The version card notices a new release without a restart (#34):** Account › OxygenHub asked the hub for releases once, when the card first showed, so an app left open kept saying "OxygenHub 0.1.6" after 0.1.7 was out until it was force-quit. It asks again each time the app comes to the front.
6 +
3 7
## 0.1.7 (2026-11-02)
4 8
5 9
- **The widget's Flow health strip shows (#33):** it was missing from 0.1.5 and 0.1.6. A widget's column shows ten children at most and drops the rest without a word, and with Needs you below the runs the strip was the eleventh; the runs and Needs you are each one block now.
…
59 unchanged lines
modified app/src/main/java/io/oxygenhub/android/update/AppUpdate.kt +10 −2
…
13 unchanged lines
14 14
import androidx.compose.ui.Modifier
15 15
import androidx.compose.ui.platform.LocalContext
16 16
import androidx.compose.ui.platform.LocalUriHandler
17 +
import androidx.lifecycle.Lifecycle
18 +
import androidx.lifecycle.compose.LocalLifecycleOwner
19 +
import androidx.lifecycle.repeatOnLifecycle
17 20
import io.oxygenhub.android.api.HubApi
18 21
import io.oxygenhub.android.api.Release
19 22
import io.oxygenhub.android.ui.common.Panel
…
43 unchanged lines
63 66
fun UpdateCard(api: HubApi, hub: String) {
64 67
    val context = LocalContext.current
65 68
    val installed = remember(context) { context.packageManager.getPackageInfo(context.packageName, 0).versionName ?: "" }
66 -
    val update by produceState<Update?>(null, hub) {
69 +
    // Asked again each time the app comes to the front, so an app left
70 +
    // open sees a release made since without a restart (#34).
71 +
    val owner = LocalLifecycleOwner.current
72 +
    val update by produceState<Update?>(null, hub, owner) {
67 73
        if (hub.trimEnd('/') == APP_HUB) {
68 -
            value = runCatching { updateFrom(api.releases(APP_OWNER, APP_REPO), installed) }.getOrNull()
74 +
            owner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
75 +
                runCatching { updateFrom(api.releases(APP_OWNER, APP_REPO), installed) }.onSuccess { value = it }
76 +
            }
69 77
        }
70 78
    }
71 79
    val uri = LocalUriHandler.current
…
11 unchanged lines