From 44ab426915cf3a608e6ecab16428321fade46027 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 2 Apr 2021 17:53:45 +0700 Subject: [PATCH] limited lab updates length at flow and at lab --- src/containers/lab/LabStats/index.tsx | 2 +- src/layouts/FlowLayout/index.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/containers/lab/LabStats/index.tsx b/src/containers/lab/LabStats/index.tsx index b248cfbd..f567884b 100644 --- a/src/containers/lab/LabStats/index.tsx +++ b/src/containers/lab/LabStats/index.tsx @@ -49,7 +49,7 @@ const LabStats: FC = () => { <>
Новые
- {updates.map(node => ( + {updates.slice(0, 10).map(node => ( ))} diff --git a/src/layouts/FlowLayout/index.tsx b/src/layouts/FlowLayout/index.tsx index e7e4ca7e..6581b676 100644 --- a/src/layouts/FlowLayout/index.tsx +++ b/src/layouts/FlowLayout/index.tsx @@ -53,7 +53,10 @@ const FlowLayout: FC = () => { [dispatch] ); - const cumulativeUpdates = useMemo(() => [...updated, ...labUpdates], [updated, labUpdates]); + const cumulativeUpdates = useMemo(() => [...updated, ...labUpdates].slice(0, 10), [ + updated, + labUpdates, + ]); useEffect(() => { window.addEventListener('scroll', onLoadMore);