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

Merge pull request #12772 from overleaf/td-history-infinite-scroll-fix

Fix bug in infinite scrolling in history view

GitOrigin-RevId: ae71e96a17197451ae583e5614adbbd9dda93ee0
Jessica Lawshe 3 лет назад
Родитель
Сommit
afb810c2a1

+ 1 - 1
services/web/frontend/js/features/history/context/history-context.tsx

@@ -42,7 +42,7 @@ function limitUpdates(
     let { updates, nextBeforeTimestamp } = response
     const maxBatchSize = maxBatchSizeParam ? parseInt(maxBatchSizeParam, 10) : 0
     const delay = delayParam ? parseInt(delayParam, 10) : 0
-    if (maxBatchSize > 0 && updates) {
+    if (maxBatchSize > 0 && updates.length > maxBatchSize) {
       updates = updates.slice(0, maxBatchSize)
       nextBeforeTimestamp = updates[updates.length - 1].fromV
     }