"Fix" loading torrent pages directly

This commit is contained in:
Drew DeVault 2017-08-25 08:57:02 -04:00
parent 1aaf8f8c0d
commit ce3653c294
2 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,6 @@ export function activeTorrents() {
} }
} }
// TODO: invoke on page load for /torrents/:id
export function updateSubscriptions(added, removed) { export function updateSubscriptions(added, removed) {
if (added.length > 0) { if (added.length > 0) {
added.forEach(t => { added.forEach(t => {

View File

@ -70,6 +70,12 @@ class Torrent extends Component {
const { torrent, files } = this.props; const { torrent, files } = this.props;
const status = s => s[0].toUpperCase() + s.slice(1); const status = s => s[0].toUpperCase() + s.slice(1);
if (!torrent || !files) {
return (
<p>Loading...</p>
);
}
return ( return (
<div> <div>
<h3>{torrent.name}</h3> <h3>{torrent.name}</h3>