Scroll to bottom when there are live call updates.

This keeps the latest messages visible when you place or receive a call.
This commit is contained in:
Kegan Dougal 2015-07-22 13:04:18 +01:00
parent e80cf8a133
commit 7e42072952

View file

@ -89,6 +89,17 @@ module.exports = {
case 'notifier_enabled':
this.forceUpdate();
break;
case 'call_state':
if (this.props.roomId !== payload.room_id) {
break;
}
// scroll to bottom
var messageWrapper = this.refs.messageWrapper;
if (messageWrapper) {
messageWrapper = messageWrapper.getDOMNode();
messageWrapper.scrollTop = messageWrapper.scrollHeight;
}
break;
}
},