mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-03 10:57:41 +01:00
fix: comment navigation at list ends (#982)
This commit is contained in:
parent
dd2f6432a5
commit
fe55a626b3
@ -959,7 +959,7 @@ class PostDetailViewModel(
|
||||
}
|
||||
val viewIndex =
|
||||
if (newIndex == lastCommentNavigateIndex) {
|
||||
((lastCommentNavigateIndex ?: newIndex) - 1).coerceAtLeast(0)
|
||||
((lastCommentNavigateIndex ?: newIndex) - 1).coerceAtLeast(1)
|
||||
} else {
|
||||
newIndex
|
||||
}
|
||||
@ -992,7 +992,7 @@ class PostDetailViewModel(
|
||||
if (newIndex == lastCommentNavigateIndex) {
|
||||
(lastCommentNavigateIndex ?: newIndex) + 1
|
||||
} else {
|
||||
newIndex
|
||||
newIndex.coerceAtLeast(lastCommentNavigateIndex ?: 0)
|
||||
}
|
||||
// save last scrolled index to make function strictly increasing
|
||||
lastCommentNavigateIndex = viewIndex
|
||||
|
Loading…
x
Reference in New Issue
Block a user