From 46b51bb710a0f5a59939f1a0965ae67f1a78013f Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 21 Nov 2023 16:02:38 +0530 Subject: [PATCH] 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. --- .../nav/destination/reader/KiwixReaderFragment.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/reader/KiwixReaderFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/reader/KiwixReaderFragment.kt index d9be58a4f..ab638536e 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/reader/KiwixReaderFragment.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/reader/KiwixReaderFragment.kt @@ -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 {