Skip to content
Snippets Groups Projects
Unverified Commit 38ea47df authored by tusooa's avatar tusooa :zap:
Browse files

Fix virtual scrolling when the user has a lot of pinned statuses

parent 96a24ec6
No related branches found
No related tags found
2 merge requests!1711Update stable - 2.5.0 release,!1523Fix virtual scrolling when the user has a lot of pinned statuses
......@@ -76,8 +76,9 @@ const Timeline = {
statusesToDisplay () {
const amount = this.timeline.visibleStatuses.length
const statusesPerSide = Math.ceil(Math.max(3, window.innerHeight / 80))
const min = Math.max(0, this.virtualScrollIndex - statusesPerSide)
const max = Math.min(amount, this.virtualScrollIndex + statusesPerSide)
const nonPinnedIndex = this.virtualScrollIndex - this.filteredPinnedStatusIds.length
const min = Math.max(0, nonPinnedIndex - statusesPerSide)
const max = Math.min(amount, nonPinnedIndex + statusesPerSide)
return this.timeline.visibleStatuses.slice(min, max).map(_ => _.id)
},
virtualScrollingEnabled () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment