Fix virtual scrolling when the user has a lot of pinned statuses
This commit is contained in:
parent
96a24ec625
commit
38ea47df89
|
@ -76,8 +76,9 @@ const Timeline = {
|
||||||
statusesToDisplay () {
|
statusesToDisplay () {
|
||||||
const amount = this.timeline.visibleStatuses.length
|
const amount = this.timeline.visibleStatuses.length
|
||||||
const statusesPerSide = Math.ceil(Math.max(3, window.innerHeight / 80))
|
const statusesPerSide = Math.ceil(Math.max(3, window.innerHeight / 80))
|
||||||
const min = Math.max(0, this.virtualScrollIndex - statusesPerSide)
|
const nonPinnedIndex = this.virtualScrollIndex - this.filteredPinnedStatusIds.length
|
||||||
const max = Math.min(amount, this.virtualScrollIndex + statusesPerSide)
|
const min = Math.max(0, nonPinnedIndex - statusesPerSide)
|
||||||
|
const max = Math.min(amount, nonPinnedIndex + statusesPerSide)
|
||||||
return this.timeline.visibleStatuses.slice(min, max).map(_ => _.id)
|
return this.timeline.visibleStatuses.slice(min, max).map(_ => _.id)
|
||||||
},
|
},
|
||||||
virtualScrollingEnabled () {
|
virtualScrollingEnabled () {
|
||||||
|
|
Loading…
Reference in New Issue