From 4cfc7e4e93e60aac9413704fca07439a7ae8f6f9 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 23 Feb 2017 14:52:29 -0800 Subject: [PATCH] Torrent name is missing once download is started The name of the torrent shows up when asking the user to confirm whether to start the download, but it doesn't show up after the download has started, which is confusing, especially when coming back to the tab. Fixes: #7362 --- .../torrent/locales/en-US/app.properties | 1 - js/webtorrent/components/torrentViewer.js | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/extensions/torrent/locales/en-US/app.properties b/app/extensions/torrent/locales/en-US/app.properties index 41ed76e8732..1cfc2137536 100644 --- a/app/extensions/torrent/locales/en-US/app.properties +++ b/app/extensions/torrent/locales/en-US/app.properties @@ -17,5 +17,4 @@ num=# downloadFile=Save File torrentStatus=Torrent Status torrentLoadingInfo=Loading torrent info... -torrentUntitled=Untitled torrent torrentLoadingMedia=Loading... diff --git a/js/webtorrent/components/torrentViewer.js b/js/webtorrent/components/torrentViewer.js index 6e19ea6ec05..3534b5a1c6d 100644 --- a/js/webtorrent/components/torrentViewer.js +++ b/js/webtorrent/components/torrentViewer.js @@ -14,18 +14,18 @@ class TorrentViewer extends React.Component { render () { const {torrent, torrentID, name, errorMessage, dispatch} = this.props - const l10nTitle = name - ? '' // No localization, just use the torrent name - : torrent - ? 'torrentLoadingInfo' // eg 'Loading torrent information...' - : 'torrentUntitled' // eg 'Untitled torrent' - const l10nStart = name ? 'startPrompt' : 'startPromptUntitled' - let titleElem, mainButtonId if (torrent) { - titleElem =
{name}
+ if (name) { + // No localization, just use the torrent name + titleElem =
{name}
+ } else { + // 'Loading torrent information...' + titleElem =
+ } mainButtonId = torrent.progress < 1 ? 'downloading' : 'seeding' } else { + const l10nStart = name ? 'startPrompt' : 'startPromptUntitled' const l10nArgs = {name} titleElem = (