diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-05-20 09:44:35 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-05-20 09:44:35 +0000 |
| commit | c93adf2e9a8ac6bfbe1e6cebde1d189475b3cb58 (patch) | |
| tree | 5abb4c3e92d84ea74a87690b168984636aecb8cc /src/components/timeline/timeline.js | |
| parent | 96a24ec6259cf2658f5d53939aa75c0bacfb657d (diff) | |
| parent | 38ea47df890e8a4b72c3b6009d1d5b8d3ec77b2e (diff) | |
Merge branch 'from/develop/tusooa/fix-vscroll-pinned' into 'develop'
Fix virtual scrolling when the user has a lot of pinned statuses
See merge request pleroma/pleroma-fe!1523
Diffstat (limited to 'src/components/timeline/timeline.js')
| -rw-r--r-- | src/components/timeline/timeline.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 8ec5d1e5..e92eb031 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -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 () { |
