Probably fix bookmarks breaking reading progress
This commit is contained in:
parent
cccf956fae
commit
992679e470
@ -322,7 +322,7 @@ class ReaderPresenter(
|
|||||||
ReaderChapterItem(
|
ReaderChapterItem(
|
||||||
it.chapter,
|
it.chapter,
|
||||||
manga!!,
|
manga!!,
|
||||||
it.chapter == currentChapter?.chapter,
|
it.chapter.id == currentChapter?.chapter?.id,
|
||||||
context,
|
context,
|
||||||
preferences.dateFormat(),
|
preferences.dateFormat(),
|
||||||
decimalFormat
|
decimalFormat
|
||||||
@ -585,10 +585,10 @@ class ReaderPresenter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SY -->
|
// SY -->
|
||||||
fun toggleBookmark(chapter: Chapter) {
|
fun toggleBookmark(chapterId: Long, bookmarked: Boolean) {
|
||||||
chapter.bookmark = !chapter.bookmark
|
val chapter = chapterList.find { it.chapter.id == chapterId }?.chapter ?: return
|
||||||
|
chapter.bookmark = bookmarked
|
||||||
db.updateChapterProgress(chapter).executeAsBlocking()
|
db.updateChapterProgress(chapter).executeAsBlocking()
|
||||||
chapterList.firstOrNull { it.chapter.id == chapter.id }?.let { it.chapter.bookmark == !chapter.bookmark }
|
|
||||||
}
|
}
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class ReaderChapterDialog(private val activity: ReaderActivity) : ReaderChapterA
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun bookmarkChapter(chapter: Chapter) {
|
override fun bookmarkChapter(chapter: Chapter) {
|
||||||
presenter.toggleBookmark(chapter)
|
presenter.toggleBookmark(chapter.id!!, !chapter.bookmark)
|
||||||
refreshList(scroll = false)
|
refreshList(scroll = false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user