From 289c6f8c731f616c73eac2739b572c13eb245680 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Tue, 10 Dec 2019 15:22:40 +0300 Subject: [PATCH] - client: fix request count in clients table --- client/src/components/Settings/Clients/ClientsTable.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/components/Settings/Clients/ClientsTable.js b/client/src/components/Settings/Clients/ClientsTable.js index fca7de51..f81e5c4f 100644 --- a/client/src/components/Settings/Clients/ClientsTable.js +++ b/client/src/components/Settings/Clients/ClientsTable.js @@ -62,10 +62,10 @@ class ClientsTable extends Component { }; }; - getStats = (ip, stats) => { + getStats = (ids, stats) => { if (stats) { - const statsForCurrentIP = stats.find(item => item.name === ip); - return statsForCurrentIP && statsForCurrentIP.count; + const currentStats = stats.find(item => ids.includes(item.name)); + return currentStats && currentStats.count; } return ''; @@ -180,8 +180,8 @@ class ClientsTable extends Component { accessor: 'statistics', minWidth: 120, Cell: (row) => { - const clientIP = row.original.ip; - const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); + const { ids } = row.original; + const clientStats = this.getStats(ids, this.props.topClients); if (clientStats) { return (