Skip to content

Commit

Permalink
Fixed: Opening SearchItem and FindInPage triggers again when switchin…
Browse files Browse the repository at this point in the history
…g back to the reader fragment.

* The issue occurred because when moving to another fragment, the `ReaderScreen` remained in the backstack and was not fully destroyed along with its data. Additionally, we were storing the `SearchItem` and `FIND_IN_PAGE` query in variables to perform these actions after restoring tabs. As a result, when reopening the `ReaderScreen`, the tabs were restored, and these variables retained their values, triggering the related actions again.
* To fix this, we have cleared these variables when the fragment is destroyed, as keeping them is unnecessary when the user navigates away from the reader screen.
  • Loading branch information
MohitMaliDeveloper committed Feb 13, 2025
1 parent 2017a4e commit 5e74d62
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,8 @@ abstract class CoreReaderFragment :

override fun onDestroyView() {
super.onDestroyView()
findInPageTitle = null
searchItemToOpen = null
restoreTabsSnackbarCallback = null
try {
coreReaderLifeCycleScope?.cancel()
Expand Down

0 comments on commit 5e74d62

Please sign in to comment.