Merge pull request #3867 from matrix-org/travis/fix-messagepanel-ref

Fix error about MessagePanel not being available for read markers
pull/21833/head
J. Ryan Stinnett 2020-01-20 11:38:27 +00:00 committed by GitHub
commit d35788476a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1136,7 +1136,9 @@ const TimelinePanel = createReactClass({
const messagePanel = this._messagePanel.current;
if (messagePanel === undefined) return null;
const wrapperRect = ReactDOM.findDOMNode(messagePanel).getBoundingClientRect();
const messagePanelNode = ReactDOM.findDOMNode(messagePanel);
if (!messagePanelNode) return null; // sometimes this happens for fresh rooms/post-sync
const wrapperRect = messagePanelNode.getBoundingClientRect();
const myUserId = MatrixClientPeg.get().credentials.userId;
const isNodeInView = (node) => {