mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Chat fix view prev msgs scroll
This commit is contained in:
@@ -151,11 +151,12 @@ export default class Chat extends React.Component {
|
|||||||
this.connect(this.props.globalData.userId)
|
this.connect(this.props.globalData.userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (prevState.selectedUser) {
|
||||||
countAllMessages(prevState.msgs) !== countAllMessages(this.state.msgs) ||
|
const prevLatest = prevState.msgs[prevState.selectedUser].lastMessage
|
||||||
prevState.selectedUser !== this.state.selectedUser
|
const newLatest = this.state.msgs[this.state.selectedUser].lastMessage
|
||||||
) {
|
if (prevLatest.date !== newLatest.date) {
|
||||||
this.scrollToChatBottom()
|
this.scrollToChatBottom()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user