From 5f6a93cac325fb04f64be4d033db54c0eca5e1b1 Mon Sep 17 00:00:00 2001 From: vapao Date: Thu, 10 Jun 2021 09:13:43 +0800 Subject: [PATCH] fix issues --- spug_web/src/pages/ssh/FileManager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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() } }