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 reader related posts loading the wrong post after rotation #15352

1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [**] Media: Fix Atomic sites video not playing issue. (https://github.com/wordpress-mobile/WordPress-Android/pull/15285)
* [*] Block editor: Fixes bug preventing button block gradient background from being updated in the editor [https://github.com/wordpress-mobile/WordPress-Android/pull/15312]
* [*] Updated the wording for the "Posts" and "Pages" entries in My Site screen [https://github.com/wordpress-mobile/WordPress-Android/pull/15327]
* [*] After navigating through a couple of related posts in Reader, load the correct post after rotation [https://github.com/wordpress-mobile/WordPress-Android/issues/14195]
dnalves marked this conversation as resolved.
Show resolved Hide resolved

18.2
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ class ReaderPostDetailFragment : ViewPagerFragment(),

initLikeFacesRecycler(savedInstanceState)
initViewModel(binding, savedInstanceState)
restoreState(savedInstanceState)
setHasOptionsMenu(true)

showPost()
}
Expand Down Expand Up @@ -841,12 +843,6 @@ class ReaderPostDetailFragment : ViewPagerFragment(),
super.onSaveInstanceState(outState)
}

override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
setHasOptionsMenu(true)
restoreState(savedInstanceState)
}

private fun restoreState(savedInstanceState: Bundle?) {
savedInstanceState?.let {
blogId = it.getLong(ReaderConstants.ARG_BLOG_ID)
Expand Down