Skip to content

Commit

Permalink
Merge pull request #3542 from kiwix/Issue#3541
Browse files Browse the repository at this point in the history
Fixed, Bookmark toggle is not on when opening bookmarks for existing opened book.
  • Loading branch information
kelson42 authored Nov 22, 2023
2 parents 43e6ce6 + 68f811b commit 0dac73c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class CustomReaderFragment : CoreReaderFragment() {
val args = CustomReaderFragmentArgs.fromBundle(requireArguments())
if (args.pageUrl.isNotEmpty()) {
loadUrlWithCurrentWebview(args.pageUrl)
// Setup bookmark for current book
// See https://github.com/kiwix/kiwix-android/issues/3541
zimReaderContainer?.zimFileReader?.let(::setUpBookmarks)
} else {
openObbOrZim()
manageExternalLaunchAndRestoringViewState()
Expand Down

0 comments on commit 0dac73c

Please sign in to comment.