Only display fields that aren't empty (post trim)
This commit is contained in:
parent
7065a635b1
commit
f21215bc67
|
@ -341,14 +341,21 @@ class AddTorrent extends Component {
|
||||||
<CardTitle>{magnet && "Magnet link" || file.name}</CardTitle>
|
<CardTitle>{magnet && "Magnet link" || file.name}</CardTitle>
|
||||||
<CardText>
|
<CardText>
|
||||||
<dl style={{marginBottom: "0"}}>
|
<dl style={{marginBottom: "0"}}>
|
||||||
{Object.keys(details).map(key =>
|
{Object.keys(details).map(key => {
|
||||||
torrent[key] && (
|
const val = torrent[key];
|
||||||
|
if (!val) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (typeof val === "string" && !val.trim()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
<div>
|
<div>
|
||||||
<dt>{key}</dt>
|
<dt>{key}</dt>
|
||||||
<dd>{details[key](torrent[key])}</dd>
|
<dd>{details[key](torrent[key])}</dd>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
)}
|
})}
|
||||||
</dl>
|
</dl>
|
||||||
</CardText>
|
</CardText>
|
||||||
</CardBlock>
|
</CardBlock>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user