(clean) comments

This commit is contained in:
ManishMadan2882
2025-03-07 20:24:38 +05:30
parent 93fea17918
commit 10c7a5f36b
5 changed files with 2 additions and 39 deletions

View File

@@ -141,15 +141,12 @@ function LogsTable({ logs, setPage, loading }: LogsTableProps) {
};
const firstObserver = useCallback((node: HTMLDivElement | null) => {
// Cleanup previous observer
if (observerRef.current) {
observerRef.current.disconnect();
}
// If node is null, just cleanup and return
if (!node) return;
// Create new observer
observerRef.current = new IntersectionObserver((entries) => {
if (entries[0].isIntersecting) {
setPage((prev) => prev + 1);
@@ -159,7 +156,6 @@ function LogsTable({ logs, setPage, loading }: LogsTableProps) {
observerRef.current.observe(node);
}, []);
// Cleanup observer on component unmount
useEffect(() => {
return () => {
if (observerRef.current) {