"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "client/src/components/Logs/InfiniteTable.js" between
AdGuardHome-0.105.1.tar.gz and AdGuardHome-0.105.2.tar.gz

About: AdGuard Home is a network-wide ads & trackers blocking DNS server. It operates as a DNS server that re-routes tracking domains to a "black hole," thus preventing your devices from connecting to those servers.

InfiniteTable.js  (AdGuardHome-0.105.1):InfiniteTable.js  (AdGuardHome-0.105.2)
import React, { import React, {
useCallback, useCallback,
useEffect, useEffect,
useRef, useRef,
} from 'react'; } from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import propTypes from 'prop-types'; import propTypes from 'prop-types';
import throttle from 'lodash/throttle'; import throttle from 'lodash/throttle';
import Loading from '../ui/Loading'; import Loading from '../ui/Loading';
import Header from './Cells/Header'; import Header from './Cells/Header';
import { getLogs } from '../../actions/queryLogs'; import { getLogs } from '../../actions/queryLogs';
import Row from './Cells'; import Row from './Cells';
import { isScrolledIntoView } from '../../helpers/helpers'; import { isScrolledIntoView } from '../../helpers/helpers';
import { QUERY_LOGS_PAGE_LIMIT } from '../../helpers/constants'; import { QUERY_LOGS_PAGE_LIMIT } from '../../helpers/constants';
skipping to change at line 28 skipping to change at line 28
isLoading, isLoading,
items, items,
isSmallScreen, isSmallScreen,
setDetailedDataCurrent, setDetailedDataCurrent,
setButtonType, setButtonType,
setModalOpened, setModalOpened,
}) => { }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const dispatch = useDispatch(); const dispatch = useDispatch();
const loader = useRef(null); const loader = useRef(null);
const loadingRef = useRef(null);
const { const isEntireLog = useSelector((state) => state.queryLogs.isEntireLog);
isEntireLog, const processingGetLogs = useSelector((state) => state.queryLogs.processingG
processingGetLogs, etLogs);
} = useSelector((state) => state.queryLogs, shallowEqual);
const loading = isLoading || processingGetLogs; const loading = isLoading || processingGetLogs;
const listener = useCallback(() => { const listener = useCallback(() => {
if (loader.current && isScrolledIntoView(loader.current)) { if (!loadingRef.current && loader.current && isScrolledIntoView(loader.c urrent)) {
dispatch(getLogs()); dispatch(getLogs());
} }
}, [loader.current, isScrolledIntoView, getLogs]); }, []);
useEffect(() => {
loadingRef.current = processingGetLogs;
}, [processingGetLogs]);
useEffect(() => { useEffect(() => {
listener(); listener();
}, [items.length < QUERY_LOGS_PAGE_LIMIT]); }, [items.length < QUERY_LOGS_PAGE_LIMIT]);
useEffect(() => { useEffect(() => {
const THROTTLE_TIME = 100; const THROTTLE_TIME = 100;
const throttledListener = throttle(listener, THROTTLE_TIME); const throttledListener = throttle(listener, THROTTLE_TIME);
window.addEventListener('scroll', throttledListener); window.addEventListener('scroll', throttledListener);
 End of changes. 5 change blocks. 
8 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)