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 @@ -2,6 +2,7 @@

18.5
-----
* [*] Fixed an issue where navigating through a couple of related posts in Reader caused the incorrect post to be loaded after rotation [https://github.com/wordpress-mobile/WordPress-Android/issues/14195]
* [*] Allow users to mark Posts as sticky [https://github.com/wordpress-mobile/WordPress-Android/pull/15351]
* [*] Fixed a crash in Page Template chooser [https://github.com/wordpress-mobile/WordPress-Android/pull/15415]

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