diff --git a/client/scripts/components/Icons/InfinityIcon.js b/client/scripts/components/Icons/InfinityIcon.js new file mode 100644 index 00000000..b94f3f26 --- /dev/null +++ b/client/scripts/components/Icons/InfinityIcon.js @@ -0,0 +1,14 @@ +import React from 'react'; + +import BaseIcon from './BaseIcon'; + +export default class InfinityIcon extends BaseIcon { + render() { + return ( + + + + ); + } +} diff --git a/client/scripts/components/Sidebar/TransferRateDetails.js b/client/scripts/components/Sidebar/TransferRateDetails.js index c2109d56..cfe7fc98 100644 --- a/client/scripts/components/Sidebar/TransferRateDetails.js +++ b/client/scripts/components/Sidebar/TransferRateDetails.js @@ -1,14 +1,15 @@ import classnames from 'classnames'; -import {FormattedMessage} from 'react-intl'; import React from 'react'; import Download from '../Icons/Download'; import Duration from '../General/Duration'; +import InfinityIcon from '../Icons/InfinityIcon'; import Size from '../General/Size'; import Upload from '../Icons/Upload'; const icons = { download: , + infinity: , upload: }; @@ -65,12 +66,9 @@ class TransferRateDetails extends React.Component { let limit = null; - console.log(throttles[slug]); if (throttles[slug] === 0) { - console.log('zero') - limit = ; + limit = icons.infinity; } else { - console.log('not zero') limit = ; } diff --git a/client/scripts/components/Sidebar/TransferRateGraph.js b/client/scripts/components/Sidebar/TransferRateGraph.js index a7318a5b..5224f222 100644 --- a/client/scripts/components/Sidebar/TransferRateGraph.js +++ b/client/scripts/components/Sidebar/TransferRateGraph.js @@ -30,14 +30,17 @@ class LineChart extends React.Component { } shouldComponentUpdate(nextProps) { + const {props: {historicalData = {}}} = this; + const {historicalData: {upload = [], download = []}} = nextProps; + if (this.isInitialRender) { - this.isInitialRender = false; + if (upload != null && upload.length > 0) { + this.isInitialRender = false; + } + return true; } - const {props: {historicalData}} = this; - const {historicalData: {upload, download}} = nextProps; - return upload.some((item, index) => { return item !== historicalData.upload[index]; }) || download.some((item, index) => {