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