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 095d5e7f0..96c7c2665 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -20,6 +20,7 @@ class MapPageComponent extends AuthComponent { telemetry: [], telemetryLastTimestamp: null }; + this.telemConsole = React.createRef(); } events = { @@ -66,8 +67,8 @@ class MapPageComponent extends AuthComponent { telemetry: newTelem, telemetryLastTimestamp: res['timestamp'] }); - var telemConsole = document.querySelector('div.telemetry-console'); - telemConsole.scrollTop = telemConsole.scrollHeight - telemConsole.clientHeight + var telemConsoleRef = this.telemConsole.current; + telemConsoleRef.scrollTop = telemConsoleRef.scrollHeight - telemConsoleRef.clientHeight this.props.onStatusChange(); } }); @@ -142,7 +143,7 @@ class MapPageComponent extends AuthComponent { renderTelemetryConsole() { return ( -