mirror of
https://github.com/zoriya/flood.git
synced 2026-06-03 03:12:14 +00:00
Fix parsing of torrent details
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ const torrentPeerPropsMap = {
|
||||
'uploadTotal',
|
||||
'id',
|
||||
'peerRate',
|
||||
'peerTotal',,
|
||||
'peerTotal',
|
||||
'isEncrypted',
|
||||
'isIncoming'
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user