Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix app returning to WebViewFragment when activity restarts
`repeatOnLifecycle(Lifecycle.State.STARTED)` caused the flow collection to be restarted after the activity was stopped and then started again (for example, when opening another activity on top and then going back). However, this triggered `handleServerState` with the current state again, which unintentionally replaced the current fragment (for example the player or settings) with the WebViewFragment. The solution is to permanently collect the latest server state, but delay its application to the lifecycle start of the activity.
- Loading branch information