Fix updating history in incognito mode #783

This commit is contained in:
Koitharu
2024-02-24 13:13:35 +02:00
parent e97a745713
commit 45c3c05f01
6 changed files with 10 additions and 3 deletions

View File

@@ -320,6 +320,7 @@ class DetailsViewModel @Inject constructor(
page = 0,
scroll = 0,
percent = percent,
force = true,
)
}
}

View File

@@ -90,8 +90,8 @@ class HistoryRepository @Inject constructor(
.distinctUntilChanged()
}
suspend fun addOrUpdate(manga: Manga, chapterId: Long, page: Int, scroll: Int, percent: Float) {
if (shouldSkip(manga)) {
suspend fun addOrUpdate(manga: Manga, chapterId: Long, page: Int, scroll: Int, percent: Float, force: Boolean) {
if (!force && shouldSkip(manga)) {
return
}
db.withTransaction {

View File

@@ -24,6 +24,7 @@ class HistoryUpdateUseCase @Inject constructor(
page = readerState.page,
scroll = readerState.scroll,
percent = percent,
force = false,
)
}

View File

@@ -30,6 +30,7 @@ class MarkAsReadUseCase @Inject constructor(
page = pages.lastIndex,
scroll = 0,
percent = 1f,
force = true,
)
}