Bladeren bron

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
HJ 2 jaren geleden
bovenliggende
commit
c93adf2e9a
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      src/components/timeline/timeline.js

+ 3 - 2
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 () {