Skip to content

Commit

Permalink
Improved the getting bookmarks for current book.
Browse files Browse the repository at this point in the history
  • Loading branch information
MohitMaliDeveloper committed Jan 27, 2025
1 parent b1c0658 commit 053b6e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ class LibkiwixBookmarks @Inject constructor(
} ?: emptyList()
}

fun bookmarkUrlsForCurrentBook(zimFileReader: ZimFileReader): Flowable<List<String>> =
fun bookmarkUrlsForCurrentBook(zimId: String): Flowable<List<String>> =
flowableBookmarkList()
.map { bookmarksList ->
bookmarksList.filter { it.zimId == zimFileReader.id }
bookmarksList.filter { it.zimId == zimId }
.map(LibkiwixBookmarkItem::bookmarkUrl)
}
.subscribeOn(Schedulers.io())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ abstract class CoreReaderFragment :
protected fun setUpBookmarks(zimFileReader: ZimFileReader) {
safeDispose()
bookmarkingDisposable = Flowable.combineLatest(
libkiwixBookmarks?.bookmarkUrlsForCurrentBook(zimFileReader),
libkiwixBookmarks?.bookmarkUrlsForCurrentBook(zimFileReader.id),
webUrlsProcessor,
List<String?>::contains
)
Expand Down

0 comments on commit 053b6e0

Please sign in to comment.