Fix parsing of torrent details

This commit is contained in:
Hussain Khalil
2017-12-04 19:02:24 -05:00
parent 019c0759ed
commit 75a1a291ad
3 changed files with 7 additions and 2 deletions
@@ -31,7 +31,7 @@ export default class TorrentPeers extends React.Component {
const {erroredCountryImages} = this.state;
const peerList = peers.map((peer, index) => {
const {country: countryCode} = peer;
const encryptedIcon = peer.isEncrypted === "1" ? checkmark : null;
const encryptedIcon = peer.isEncrypted ? checkmark : null;
let peerCountry = null;
if (countryCode) {
+5
View File
@@ -94,6 +94,11 @@ let clientResponseUtil = {
).map((peer) => {
let geoData = geoip.lookup(peer.address) || {};
peer.country = geoData.country;
// Strings to boolean
peer.isEncrypted = peer.isEncrypted === '1';
peer.isIncoming = peer.isIncoming === '1';
return peer;
});
}
+1 -1
View File
@@ -11,7 +11,7 @@ const torrentPeerPropsMap = {
'uploadTotal',
'id',
'peerRate',
'peerTotal',,
'peerTotal',
'isEncrypted',
'isIncoming'
],