Просмотр исходного кода

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
Henry Jameson 2 лет назад
Родитель
Сommit
2c876f455a
2 измененных файлов с 7 добавлено и 3 удалено
  1. 3 2
      src/components/timeline/timeline.js
  2. 4 1
      src/modules/serverSideConfig.js

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

+ 4 - 1
src/modules/serverSideConfig.js

@@ -55,7 +55,10 @@ export const settingsMap = {
     get: 'pleroma.allow_following_move',
     set: 'allow_following_move'
   },
-  'discoverable': 'source.discoverable',
+  'discoverable': {
+    get: 'source.pleroma.discoverable',
+    set: 'discoverable'
+  },
   'hideFavorites': {
     get: 'pleroma.hide_favorites',
     set: 'hide_favorites'