diff --git a/client/src/javascript/components/modals/torrent-details-modal/TorrentPeers.js b/client/src/javascript/components/modals/torrent-details-modal/TorrentPeers.js index 1434380a..2624bf2c 100644 --- a/client/src/javascript/components/modals/torrent-details-modal/TorrentPeers.js +++ b/client/src/javascript/components/modals/torrent-details-modal/TorrentPeers.js @@ -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) { diff --git a/server/util/clientResponseUtil.js b/server/util/clientResponseUtil.js index b7f415fd..abcecfbf 100644 --- a/server/util/clientResponseUtil.js +++ b/server/util/clientResponseUtil.js @@ -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; }); } diff --git a/shared/constants/torrentPeerPropsMap.js b/shared/constants/torrentPeerPropsMap.js index e15f696e..751656bd 100644 --- a/shared/constants/torrentPeerPropsMap.js +++ b/shared/constants/torrentPeerPropsMap.js @@ -11,7 +11,7 @@ const torrentPeerPropsMap = { 'uploadTotal', 'id', 'peerRate', - 'peerTotal',, + 'peerTotal', 'isEncrypted', 'isIncoming' ],