mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-02-20 18:52:27 +00:00
Fix message scrollar
This commit is contained in:
parent
4f2a9d78db
commit
04da117657
1 changed files with 4 additions and 4 deletions
|
@ -193,8 +193,6 @@ const Chatroom = exports.Chatroom = React.createClass({
|
|||
componentDidMount() {
|
||||
let self = this;
|
||||
|
||||
Ps.initialize(document.getElementById('chatmessages'));
|
||||
|
||||
this.scrollListener = _.debounce((event) => {
|
||||
self.temporarilyDisableAutoScroll(event);
|
||||
}, 300, {
|
||||
|
@ -248,8 +246,10 @@ const Chatroom = exports.Chatroom = React.createClass({
|
|||
}, 10000);
|
||||
},
|
||||
|
||||
componentDidUpdate() {
|
||||
this.scrollToBottom();
|
||||
componentDidUpdate(prevProps) {
|
||||
if (prevProps.messages.length < this.props.messages.length) {
|
||||
this.scrollToBottom();
|
||||
}
|
||||
},
|
||||
|
||||
scrollToBottom() {
|
||||
|
|
Loading…
Reference in a new issue