From de554bfa0beb751c8341322bc857e4811ec2bd4c Mon Sep 17 00:00:00 2001 From: Shreya Date: Thu, 12 Mar 2020 22:40:25 +0530 Subject: [PATCH] Code formatting --- .../cc/ui/src/components/pages/MapPage.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js index 78e8ba1d3..ed84563a0 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -19,7 +19,7 @@ class MapPageComponent extends AuthComponent { showKillDialog: false, telemetry: [], telemetryLastTimestamp: null, - movedTop: false, + isScrolledUp: false, }; this.telemConsole = React.createRef(); this.handleScroll = this.handleScroll.bind(this); @@ -73,7 +73,7 @@ class MapPageComponent extends AuthComponent { this.props.onStatusChange(); let telemConsoleRef = this.telemConsole.current; - if(!this.state.movedTop){ + if (!this.state.isScrolledUp) { telemConsoleRef.scrollTop = telemConsoleRef.scrollHeight - telemConsoleRef.clientHeight; this.scrollTop = telemConsoleRef.scrollTop; } @@ -148,15 +148,13 @@ class MapPageComponent extends AuthComponent { ); } - handleScroll(e){ - + handleScroll(e) { let element = e.target; - if(element.scrollTop < this.scrollTop){ - this.setState({movedTop: true}); - }else{ - this.setState({movedTop: false}); + if (element.scrollTop < this.scrollTop) { + this.setState({isScrolledUp: true}); + } else { + this.setState({isScrolledUp: false}); } - } renderTelemetryConsole() {