mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-17 06:27:29 +01:00
Use SQLDelight for all Chapter related queries (#7440)
This commit is contained in:
@@ -540,13 +540,16 @@ class ReaderPresenter(
|
||||
* Bookmarks the currently active chapter.
|
||||
*/
|
||||
fun bookmarkCurrentChapter(bookmarked: Boolean) {
|
||||
if (getCurrentChapter()?.chapter == null) {
|
||||
return
|
||||
val chapter = getCurrentChapter()?.chapter ?: return
|
||||
chapter.bookmark = bookmarked // Otherwise the bookmark icon doesn't update
|
||||
launchIO {
|
||||
updateChapter.await(
|
||||
ChapterUpdate(
|
||||
id = chapter.id!!.toLong(),
|
||||
bookmark = bookmarked,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
val chapter = getCurrentChapter()?.chapter!!
|
||||
chapter.bookmark = bookmarked
|
||||
db.updateChapterProgress(chapter).executeAsBlocking()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user