Merge pull request #2104 from matrix-org/bwindels/backpaginate_ll

Lazy loading: Lazy load members while backpaginating
This commit is contained in:
Bruno Windels 2018-08-03 14:57:02 +02:00 committed by GitHub
commit 27ee85f4d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View file

@ -34,14 +34,6 @@ interface MatrixClientCreds {
guest: boolean,
}
const FILTER_CONTENT = {
room: {
state: {
lazy_load_members: true,
},
},
};
/**
* Wrapper object for handling the js-sdk Matrix Client object in the react-sdk
* Handles the creation/initialisation of client objects.
@ -108,7 +100,7 @@ class MatrixClientPeg {
opts.pendingEventOrdering = "detached";
if (SettingsStore.isFeatureEnabled('feature_lazyloading')) {
opts.filter = await this.matrixClient.createFilter(FILTER_CONTENT);
opts.lazyLoadMembers = true;
}
try {
@ -127,7 +119,7 @@ class MatrixClientPeg {
MatrixActionCreators.start(this.matrixClient);
console.log(`MatrixClientPeg: really starting MatrixClient`);
this.get().startClient(opts);
await this.get().startClient(opts);
console.log(`MatrixClientPeg: MatrixClient started`);
}

View file

@ -187,6 +187,9 @@ const Pill = React.createClass({
getContent: () => {
return {avatar_url: resp.avatar_url};
},
getDirectionalContent: function() {
return this.getContent();
},
};
this.setState({member});
}).catch((err) => {