-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Currently watches field is backed by a MutableStateFlow
that starts with an emptyList()
and then, eventually, this field will get populated from the database asynchronously.
This presents a problem: there is no way to distinguish between "watches have been loaded and user's watch list is empty" vs "watch list is yet to be loaded" states.
My use case for this is to, on phone boot, only start the app background service if there are any enabled watches to actually connect. Since this is on startup, I would get an empty list immediately and then after some undetermined time, list would get populated.
Ideally, this flow would be modified to not emit anything until the list is loaded, but I'm not sure how much would that break things on your side. As an alternative, we can add a watchesLoaded: Flow<Boolean>
field to the Watches
. What do you think? I can submit a PR.