From 85d6994719a724e8dd0828bb90c459a422767d12 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Fri, 27 Sep 2019 14:32:52 +0300 Subject: [PATCH] - client: check if data loaded before the request with older_than --- client/src/components/Logs/index.js | 2 +- client/src/reducers/queryLogs.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Logs/index.js b/client/src/components/Logs/index.js index a0bd2db7..6ce8eef2 100644 --- a/client/src/components/Logs/index.js +++ b/client/src/components/Logs/index.js @@ -265,7 +265,7 @@ class Logs extends Component { fetchData = (state) => { const { pageSize, page, pages } = state; const { allLogs, filter } = this.props.queryLogs; - const isLastPage = page + 1 === pages; + const isLastPage = pages && (page + 1 === pages); if (isLastPage) { const lastRow = allLogs[allLogs.length - 1]; diff --git a/client/src/reducers/queryLogs.js b/client/src/reducers/queryLogs.js index 857a6ae1..2f04099b 100644 --- a/client/src/reducers/queryLogs.js +++ b/client/src/reducers/queryLogs.js @@ -90,7 +90,7 @@ const queryLogs = handleActions( logs: [], interval: 1, allLogs: [], - pages: 1, + pages: 0, total: 0, enabled: true, older_than: '',