From afb810c2a1866d854227503b5937e8b5f6cc4474 Mon Sep 17 00:00:00 2001 From: Jessica Lawshe <5312836+lawshe@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:56:23 -0500 Subject: [PATCH] Merge pull request #12772 from overleaf/td-history-infinite-scroll-fix Fix bug in infinite scrolling in history view GitOrigin-RevId: ae71e96a17197451ae583e5614adbbd9dda93ee0 --- .../frontend/js/features/history/context/history-context.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/history/context/history-context.tsx b/services/web/frontend/js/features/history/context/history-context.tsx index 03a5dd14c5..cd694aa04d 100644 --- a/services/web/frontend/js/features/history/context/history-context.tsx +++ b/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 }