diff --git a/spug_web/src/pages/ssh/FileManager.js b/spug_web/src/pages/ssh/FileManager.js index af70e41e..55bdd55a 100644 --- a/spug_web/src/pages/ssh/FileManager.js +++ b/spug_web/src/pages/ssh/FileManager.js @@ -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() } }