-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(android): leave / rejoin predictions & alerts after backgrounding #588
Conversation
@@ -98,7 +98,7 @@ fun HomeMapView( | |||
var railRouteLineData: List<RouteLineData>? by remember { mutableStateOf(null) } | |||
var stopSourceData: FeatureCollection? by remember { mutableStateOf(null) } | |||
|
|||
val now = timer(updateInterval = 10.seconds) | |||
val now = timer(updateInterval = 300.seconds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed this was causing lag / jankiness and saw the iOS value is 300 seconds, so updated to match.
This can be further improved by moving getAlertsByStop
to a background thread for calculation since the calculation alone takes ~1 second. That wasn't straight forward to do within the remember
func though, and would probably need to be moved into the ViewModel. I can make a separate ticket for that
connectToPredictions() | ||
override fun onCleared() { | ||
super.onCleared() | ||
predictionsRepository.disconnect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Should this call the vm's disconnect()
instead?
46dc1ed
to
8b36601
Compare
b2d38b7
to
b5740cd
Compare
android-only change, ran iOS app locally and confirmed unaffected. Merging before iOS workflows complete |
Summary
Ticket: 🤖 | Stability | Leave realtime channels when backgrounding
What is this PR for?
Follow-up to #579, applies the same pattern to predictions & alerts.
iOS
android
Testing
What testing have you done?