aboutsummaryrefslogtreecommitdiff
path: root/src/components/timeline
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-05-20 12:45:06 +0300
committerHenry Jameson <me@hjkos.com>2022-05-20 12:45:06 +0300
commit2c876f455af53e25cd7f193aab9c12031956ec07 (patch)
tree965132878c78927d010f26ca16007e27271beda5 /src/components/timeline
parentc83657a072dc0d6e77a9c866147094099fb5dc24 (diff)
parentc93adf2e9a8ac6bfbe1e6cebde1d189475b3cb58 (diff)
Merge remote-tracking branch 'origin/develop' into threecolumn
* origin/develop: Fix virtual scrolling when the user has a lot of pinned statuses fix "allow discovery" setting misbehaving
Diffstat (limited to 'src/components/timeline')
-rw-r--r--src/components/timeline/timeline.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 94f0e916..c575e876 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -77,8 +77,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 () {