From ce3653c29409e37ef8ad5e4d06792aa0959ace86 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 25 Aug 2017 08:57:02 -0400 Subject: [PATCH] "Fix" loading torrent pages directly --- src/torrent_state.js | 1 - src/ui/torrent_details.js | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/torrent_state.js b/src/torrent_state.js index ce30464..b4128d9 100644 --- a/src/torrent_state.js +++ b/src/torrent_state.js @@ -12,7 +12,6 @@ export function activeTorrents() { } } -// TODO: invoke on page load for /torrents/:id export function updateSubscriptions(added, removed) { if (added.length > 0) { added.forEach(t => { diff --git a/src/ui/torrent_details.js b/src/ui/torrent_details.js index b2238f4..1df01ea 100644 --- a/src/ui/torrent_details.js +++ b/src/ui/torrent_details.js @@ -70,6 +70,12 @@ class Torrent extends Component { const { torrent, files } = this.props; const status = s => s[0].toUpperCase() + s.slice(1); + if (!torrent || !files) { + return ( +

Loading...

+ ); + } + return (

{torrent.name}