Fixed, Bookmark toggle is not on when opening bookmarks for existing opened book.

* Fixed the issue by correctly setting up the bookmark disposable for the current ZIM file when opening bookmarks for the currently opened book.
This commit is contained in:
MohitMaliFtechiz 2023-11-21 16:02:38 +05:30
parent 43e6ce6bee
commit 46b51bb710

View File

@ -89,6 +89,12 @@ class KiwixReaderFragment : CoreReaderFragment() {
if (args.pageUrl.isNotEmpty()) {
if (args.zimFileUri.isNotEmpty()) {
tryOpeningZimFile(args.zimFileUri)
} else {
// Set up bookmarks for the current book when opening bookmarks from the Bookmark screen.
// This is necessary because we are not opening the ZIM file again; the bookmark is
// inside the currently opened book. Bookmarks are set up when opening the ZIM file.
// See https://github.com/kiwix/kiwix-android/issues/3541
zimReaderContainer?.zimFileReader?.let(::setUpBookmarks)
}
loadUrlWithCurrentWebview(args.pageUrl)
} else {