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

Fix error about MessagePanel not being available for read markers
This commit is contained in:
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

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) => {