fix issue

pull/365/head
vapao 2021-07-10 17:07:58 +08:00
parent 3e432268a8
commit 6ee42484e5
1 changed files with 3 additions and 2 deletions

View File

@ -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()
} }
} }