From 473f2dd72b15255939b17a9cf8e45277ff373361 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 17 Sep 2018 19:24:34 +0200 Subject: [PATCH] pass room to _loadMembersIfJoined, it's called when newState not applied _loadMembersIfJoined is called from _onRoomLoaded < _onRoomViewStoreUpdate, before incoming state from the store is applied to this.state, so looking up the room with this.state.roomId doesn't always work, which would cause the members not to be loaded. Pass in the room instead. --- src/components/structures/RoomView.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index cf99bb9fc3..8e2c2e3fdd 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -582,14 +582,13 @@ module.exports = React.createClass({ this._warnAboutEncryption(room); this._calculatePeekRules(room); this._updatePreviewUrlVisibility(room); - this._loadMembersIfJoined(); + this._loadMembersIfJoined(room); }, - _loadMembersIfJoined: async function() { + _loadMembersIfJoined: async function(room) { // lazy load members if enabled if (SettingsStore.isFeatureEnabled('feature_lazyloading')) { const cli = MatrixClientPeg.get(); - const room = cli.getRoom(this.state.roomId); if (room && room.getMyMembership() === 'join') { try { await room.loadMembersIfNeeded();