diff --git a/app/lib/components/Chat/FileChatEntry.jsx b/app/lib/components/Chat/FileChatEntry.jsx index d2d397d..a0890ba 100644 --- a/app/lib/components/Chat/FileChatEntry.jsx +++ b/app/lib/components/Chat/FileChatEntry.jsx @@ -40,7 +40,7 @@ class FileChatEntry extends Component { this.setState({ numPeers : torrent.numPeers, - progress : Math.round(torrent.progress * 100 * 100) / 100 + progress : torrent.progress }); }; @@ -53,7 +53,8 @@ class FileChatEntry extends Component clearInterval(onProgress); this.setState({ - files : torrent.files + files : torrent.files, + active: false }); }); }); @@ -64,23 +65,32 @@ class FileChatEntry extends Component return (
- + {!this.state.active && !this.state.files && ( + +

A new file was shared.

- {this.state.active && ( + +
+ )} + + {this.state.active && this.state.numPeers === 0 && (
- peers: {this.state.numPeers} - progress: {this.state.progress} + Locating peers
)} + {this.state.active && this.state.numPeers > 0 && ( + + )} + {this.state.files && (
{this.state.files.map((file, i) => (
))}