From 311b640ef6f1d4512bed22fc1cf2de66e9107df4 Mon Sep 17 00:00:00 2001 From: Oskar Hane Date: Fri, 6 Mar 2020 11:56:05 +0100 Subject: [PATCH] Fix scroll to top bug when a frame was deleted --- src/browser/modules/Stream/Stream.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/browser/modules/Stream/Stream.jsx b/src/browser/modules/Stream/Stream.jsx index e3979bd4944..8c82087320f 100644 --- a/src/browser/modules/Stream/Stream.jsx +++ b/src/browser/modules/Stream/Stream.jsx @@ -86,8 +86,9 @@ class Stream extends PureComponent { } componentDidUpdate(prevProps) { + // If we want to scroll to top when a new frame is added if ( - prevProps.framesSignature !== this.props.framesSignature && + prevProps.frames.length < this.props.frames.length && this.props.scrollToTop && this.base && this.base.current @@ -125,9 +126,6 @@ class Stream extends PureComponent { const mapStateToProps = state => { const frames = getFrames(state) return { - framesSignature: frames - .map(frame => frame.id + (frame.requestId || '')) - .join(''), frames, activeConnectionData: getActiveConnectionData(state), scrollToTop: getScrollToTop(state)