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') {
|
||||
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