mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #3478 from omnivore-app/fix/reduce-reading-progress
Use the DB stored reading progress when calculating maxes
This commit is contained in:
commit
fe5d986e91
1 changed files with 14 additions and 5 deletions
|
|
@ -171,7 +171,10 @@ const readingProgressHandlers = {
|
||||||
article.id
|
article.id
|
||||||
)
|
)
|
||||||
if (readingProgress) {
|
if (readingProgress) {
|
||||||
return readingProgress.readingProgressPercent
|
return Math.max(
|
||||||
|
article.readingProgressPercent ?? 0,
|
||||||
|
readingProgress.readingProgressPercent
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return article.readingProgressPercent
|
return article.readingProgressPercent
|
||||||
|
|
@ -187,8 +190,11 @@ const readingProgressHandlers = {
|
||||||
ctx.claims?.uid,
|
ctx.claims?.uid,
|
||||||
article.id
|
article.id
|
||||||
)
|
)
|
||||||
if (readingProgress) {
|
if (readingProgress && readingProgress.readingProgressAnchorIndex) {
|
||||||
return readingProgress.readingProgressAnchorIndex
|
return Math.max(
|
||||||
|
article.readingProgressAnchorIndex ?? 0,
|
||||||
|
readingProgress.readingProgressAnchorIndex
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return article.readingProgressAnchorIndex
|
return article.readingProgressAnchorIndex
|
||||||
|
|
@ -204,8 +210,11 @@ const readingProgressHandlers = {
|
||||||
ctx.claims?.uid,
|
ctx.claims?.uid,
|
||||||
article.id
|
article.id
|
||||||
)
|
)
|
||||||
if (readingProgress) {
|
if (readingProgress && readingProgress.readingProgressTopPercent) {
|
||||||
return readingProgress.readingProgressTopPercent
|
return Math.max(
|
||||||
|
article.readingProgressTopPercent ?? 0,
|
||||||
|
readingProgress.readingProgressTopPercent
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return article.readingProgressTopPercent
|
return article.readingProgressTopPercent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue