diff --git a/client/src/components/Dashboard/Clients.js b/client/src/components/Dashboard/Clients.js index 57d97e7f..a9fa4792 100644 --- a/client/src/components/Dashboard/Clients.js +++ b/client/src/components/Dashboard/Clients.js @@ -23,22 +23,7 @@ class Clients extends Component { Header: 'IP', accessor: 'ip', Cell: ({ value }) => (
{value}
), - sortMethod: (a, b) => { - const nextValue = a.split('.'); - const prevValue = b.split('.'); - - for (let i = 0; i < nextValue.length; i += 1) { - const nextNumber = parseInt(nextValue[i], 10); - const prevNumber = parseInt(prevValue[i], 10); - - if (nextNumber < prevNumber) { - return -1; - } else if (nextNumber > prevNumber) { - return 1; - } - } - return 0; - }, + sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), }, { Header: 'Requests count', accessor: 'count',