From da5739be8f5ef86306628a37c06a0673bd460be7 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Wed, 24 Jan 2024 17:27:49 -0500 Subject: [PATCH] - Progress Signed-off-by: Dave Richer --- client/src/components/eula/eula.component.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/eula/eula.component.jsx b/client/src/components/eula/eula.component.jsx index b73f39052..c1130c783 100644 --- a/client/src/components/eula/eula.component.jsx +++ b/client/src/components/eula/eula.component.jsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useRef, useState } from "react"; -import {Button, Card, Checkbox, Col, Form, Input, Modal, notification, Row, Space} from "antd"; +import {Button, Card, Checkbox, Col, Form, Input, Modal, notification, Row} from "antd"; import Markdown from "react-markdown"; import { createStructuredSelector } from "reselect"; import { selectCurrentEula, selectCurrentUser } from "../../redux/user/user.selectors"; @@ -22,18 +22,18 @@ const Eula = ({ currentEula, currentUser, acceptEula }) => { const { t } = useTranslation(); const [api, contextHolder] = notification.useNotification(); - const handleScroll = (e) => { + const handleScroll = useCallback((e) => { const bottom = e.target.scrollHeight - 100 <= e.target.scrollTop + e.target.clientHeight; if (bottom && !hasEverScrolledToBottom) { setHasEverScrolledToBottom(true); } else if (e.target.scrollHeight <= e.target.clientHeight && !hasEverScrolledToBottom) { setHasEverScrolledToBottom(true); } - }; + }, [hasEverScrolledToBottom, setHasEverScrolledToBottom]); useEffect(() => { handleScroll({ target: markdownCardRef.current }); - }, []); + }, [handleScroll]); const handleChange = useCallback(() => { form.validateFields({ validateOnly: true })