diff --git a/src/ui/torrent_details.js b/src/ui/torrent_details.js
index 940e5d3..527fafc 100644
--- a/src/ui/torrent_details.js
+++ b/src/ui/torrent_details.js
@@ -37,13 +37,15 @@ function basename(path) {
class File extends Component {
shouldComponentUpdate(nextProps, _) {
- return nextProps.file !== this.props.file;
+ return nextProps.file !== this.props.file
+ || nextProps.server !== this.props.server
+ || nextProps.socket !== this.props.socket;
}
render() {
- const { dispatch, file } = this.props;
- const { uri } = store.getState().socket;
- const { download_token } = store.getState().server;
+ const { dispatch, file, server, socket } = this.props;
+ const { download_token } = server;
+ const { uri } = socket;
return (
@@ -390,6 +405,8 @@ class TorrentDetails extends Component {
trackers,
peers,
selection,
+ server,
+ socket,
dispatch
} = this.props;
const index_by_tid = (res) => {
@@ -416,6 +433,8 @@ class TorrentDetails extends Component {
files={_files[id] || []}
trackers={_trackers[id] || []}
peers={_peers[id] || []}
+ server={server}
+ socket={socket}
key={id}
/>)}
{selection.length > 3 ?
@@ -437,5 +456,6 @@ export default connect(state => ({
trackers: state.trackers,
peers: state.peers,
selection: state.selection,
- server: state.server
+ server: state.server,
+ socket: state.socket,
}))(TorrentDetails);