From 538261aa997ac69bb95a557ef07fc4c13ebd7bee Mon Sep 17 00:00:00 2001 From: Yevhen Shevchenko <90138953+yeshev@users.noreply.github.com> Date: Wed, 12 Jul 2023 18:20:17 +0300 Subject: [PATCH] fix: list pagination (#3121) --- frontend/src/container/LogsExplorerViews/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/container/LogsExplorerViews/index.tsx b/frontend/src/container/LogsExplorerViews/index.tsx index 0a7d643c03..580b80e200 100644 --- a/frontend/src/container/LogsExplorerViews/index.tsx +++ b/frontend/src/container/LogsExplorerViews/index.tsx @@ -271,6 +271,7 @@ function LogsExplorerViews(): JSX.Element { const handleEndReached = useCallback( (index: number) => { if (isLimit) return; + if (logs.length < pageSize) return; const lastLog = logs[index]; @@ -368,7 +369,7 @@ function LogsExplorerViews(): JSX.Element { useEffect(() => { const shouldChangeView = isMultipleQueries || isGroupByExist; - if (panelType === 'list' && shouldChangeView) { + if (panelType === PANEL_TYPES.LIST && shouldChangeView) { handleChangeView(PANEL_TYPES.TIME_SERIES); } }, [panelType, isMultipleQueries, isGroupByExist, handleChangeView]);