Only attempt to maintain scroll position when prepending messages if there was previously any messages
This commit is contained in:
parent
0e46fbcc82
commit
8f1105bc59
File diff suppressed because one or more lines are too long
@ -58,7 +58,7 @@ export default class MessageBox extends PureComponent {
|
|||||||
if (prevProps.messages[0] !== this.props.messages[0]) {
|
if (prevProps.messages[0] !== this.props.messages[0]) {
|
||||||
const { messages, hasMoreMessages } = this.props;
|
const { messages, hasMoreMessages } = this.props;
|
||||||
|
|
||||||
if (prevProps.tab === this.props.tab) {
|
if (prevProps.tab === this.props.tab && prevProps.messages.length > 0) {
|
||||||
const addedMessages = messages.length - prevProps.messages.length;
|
const addedMessages = messages.length - prevProps.messages.length;
|
||||||
let addedHeight = 0;
|
let addedHeight = 0;
|
||||||
for (let i = 0; i < addedMessages; i++) {
|
for (let i = 0; i < addedMessages; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user