Skip to content
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

Fix app returning to WebViewFragment when activity restarts #1171

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

Maxr1998
Copy link
Member

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.

`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.
@Maxr1998 Maxr1998 added the bug Something isn't working label Aug 24, 2023
@Maxr1998 Maxr1998 added this to the v2.6.0 milestone Aug 24, 2023
@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Aug 24, 2023
@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Aug 24, 2023
@nielsvanvelzen nielsvanvelzen merged commit fecd370 into master Aug 25, 2023
@nielsvanvelzen nielsvanvelzen deleted the fix-state-loss branch August 25, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants