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.
This commit is contained in:
parent
e0a789f77e
commit
473f2dd72b
1 changed files with 2 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue