1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

limited lab updates length at flow and at lab

This commit is contained in:
Fedor Katurov 2021-04-02 17:53:45 +07:00
parent b1e68a8a6d
commit 44ab426915
2 changed files with 5 additions and 2 deletions

View file

@ -49,7 +49,7 @@ const LabStats: FC<IProps> = () => {
<> <>
<div className={styles.title}>Новые</div> <div className={styles.title}>Новые</div>
<Group className={styles.updates}> <Group className={styles.updates}>
{updates.map(node => ( {updates.slice(0, 10).map(node => (
<FlowRecentItem node={node} key={node.id} has_new /> <FlowRecentItem node={node} key={node.id} has_new />
))} ))}
</Group> </Group>

View file

@ -53,7 +53,10 @@ const FlowLayout: FC = () => {
[dispatch] [dispatch]
); );
const cumulativeUpdates = useMemo(() => [...updated, ...labUpdates], [updated, labUpdates]); const cumulativeUpdates = useMemo(() => [...updated, ...labUpdates].slice(0, 10), [
updated,
labUpdates,
]);
useEffect(() => { useEffect(() => {
window.addEventListener('scroll', onLoadMore); window.addEventListener('scroll', onLoadMore);