1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

Merge pull request #3867 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

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