Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vapao committed Jun 10, 2021
1 parent ead72c2 commit 5f6a93c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spug_web/src/pages/ssh/FileManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 5f6a93c

Please sign in to comment.