Lexically sort torrent and file lists by default

This commit is contained in:
Luminarys 2017-11-12 11:30:24 -08:00
parent 69d428763e
commit b5d8304651
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ class Torrent extends Component {
<CardBlock>
<table className="table table-striped" style={{marginBottom: "0"}}>
<tbody>
{files.map(file => <File file={file} />)}
{files.slice().sort((a, b) => a.path.localeCompare(b.path)).map(file => <File file={file} />)}
</tbody>
</table>
</CardBlock>

View File

@ -33,7 +33,7 @@ class TorrentTable extends Component {
</tr>
</thead>
<tbody>
{Object.values(torrents).map(t =>
{Object.values(torrents).slice().sort((a, b) => a.name.localeCompare(b.name)).map(t =>
<tr
key={t.id}
className={`torrent ${