You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
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:
@ -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();
|
||||
|
Reference in New Issue
Block a user