mirror of https://github.com/openspug/spug
parent
ead72c2687
commit
5f6a93cac3
|
@ -143,8 +143,9 @@ class FileManager extends React.Component {
|
|||
if (e.data === 'pong') {
|
||||
this.socket.send('ping')
|
||||
} else {
|
||||
this.setState({percent: Number(e.data)});
|
||||
if (Number(e.data) === 100) {
|
||||
const percent = Number(e.data);
|
||||
if (percent > this.state.percent) this.setState({percent});
|
||||
if (percent === 100) {
|
||||
this.socket.close()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue