fix issues

pull/330/head v3.0.1-beta.1
vapao 2021-06-10 09:13:43 +08:00
parent ead72c2687
commit 5f6a93cac3
1 changed files with 3 additions and 2 deletions

View File

@ -143,8 +143,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()
} }
} }