From c22538fb08bafb0573df8e86431472d9c0af939a Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 13 Mar 2020 21:14:28 +0530 Subject: [PATCH] Simplify code --- .../cc/ui/src/components/pages/MapPage.js | 11 +---------- 1 file changed, 1 insertion(+), 10 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 d92030437..88c192437 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -157,19 +157,10 @@ class MapPageComponent extends AuthComponent { let telemetryLineHeight = parseInt((telemetryStyle.lineHeight).replace('px', '')) this.setState({ + isScrolledUp: !!(element.scrollTop < this.scrollTop), telemetryCurrentLine: parseInt(element.scrollTop/telemetryLineHeight)+1, telemetryLines: parseInt(element.scrollHeight/telemetryLineHeight) }); - - if (element.scrollTop < this.scrollTop) { - this.setState({ - isScrolledUp: true - }); - } else { - this.setState({ - isScrolledUp: false - }); - } } renderTelemetryConsole() {