Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Better title handling with internationalization code
Browse files Browse the repository at this point in the history
Always show torrent title -- even if internationalization code runs
after it's set.
  • Loading branch information
feross committed Mar 18, 2017
1 parent efefed2 commit bd2d0c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/extensions/torrent/locales/en-US/app.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ torrentLoadingInfo=Loading torrent info...
torrentUntitled=Untitled torrent
torrentLoadingMedia=Loading...
copyMagnetLink=Copy Magnet Link
webtorrentPage=WebTorrent
4 changes: 1 addition & 3 deletions js/webtorrent/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ function init () {
return onError(new Error('Invalid torrent identifier'))
}

document.title = store.name

// Create the client, set up IPC to the WebTorrentRemoteServer
client = new WebTorrentRemoteClient(send)
client.on('warning', onWarning)
Expand Down Expand Up @@ -104,6 +102,7 @@ function send (msg) {
function update () {
const elem = <App store={store} dispatch={dispatch} />
ReactDOM.render(elem, document.querySelector('#appContainer'))
document.title = store.name || 'WebTorrent'
}

function onAdded (err, torrent) {
Expand All @@ -124,7 +123,6 @@ function initTorrent (torrent) {
// Once torrent's canonical name is available, use it
if (torrent.name) {
store.name = torrent.name
document.title = store.name
}

torrent.on('warning', onWarning)
Expand Down

0 comments on commit bd2d0c9

Please sign in to comment.