увеличена скорость получание информации о размерах
This commit is contained in:
@ -73,6 +73,9 @@ export default class RecentTorrents extends Component {
|
||||
});
|
||||
}
|
||||
render() {
|
||||
if(!this.torrents || this.torrents.length == 0)
|
||||
return null;
|
||||
|
||||
return (
|
||||
<List className='animated'>
|
||||
<Subheader inset={true}>Most recent torrents</Subheader>
|
||||
@ -82,7 +85,7 @@ export default class RecentTorrents extends Component {
|
||||
return <TorrentLine key={index} torrent={torrent} />;
|
||||
})
|
||||
}
|
||||
</List>
|
||||
</List>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import TextField from 'material-ui/TextField';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import RefreshIndicator from 'material-ui/RefreshIndicator';
|
||||
|
||||
import formatBytes from './format-bytes'
|
||||
|
||||
export default class Search extends Component {
|
||||
constructor(props)
|
||||
{
|
||||
@ -28,6 +30,10 @@ export default class Search extends Component {
|
||||
this.stats = statistic;
|
||||
this.forceUpdate();
|
||||
});
|
||||
window.torrentSocket.on('newStatistic', (statistic) => {
|
||||
this.stats = statistic;
|
||||
this.forceUpdate();
|
||||
});
|
||||
}
|
||||
render() {
|
||||
const style = {
|
||||
@ -59,7 +65,7 @@ export default class Search extends Component {
|
||||
{
|
||||
this.stats
|
||||
?
|
||||
<div className='fs0-75' style={{color: 'rgba(0, 0, 0, 0.541176)'}}>we have {this.stats.torrents} torrents and around {this.stats.files} files here</div>
|
||||
<div className='fs0-75' style={{color: 'rgba(0, 0, 0, 0.541176)'}}>we have information about {this.stats.torrents} torrents and around {this.stats.files} files and { formatBytes(this.stats.size, 1) } of data</div>
|
||||
:
|
||||
null
|
||||
}
|
||||
|
Reference in New Issue
Block a user