mirror of
https://github.com/element-hq/element-web.git
synced 2024-11-30 23:31:28 +03:00
Merge pull request #2104 from matrix-org/bwindels/backpaginate_ll
Lazy loading: Lazy load members while backpaginating
This commit is contained in:
commit
27ee85f4d9
2 changed files with 5 additions and 10 deletions
|
@ -34,14 +34,6 @@ interface MatrixClientCreds {
|
||||||
guest: boolean,
|
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
|
* Wrapper object for handling the js-sdk Matrix Client object in the react-sdk
|
||||||
* Handles the creation/initialisation of client objects.
|
* Handles the creation/initialisation of client objects.
|
||||||
|
@ -108,7 +100,7 @@ class MatrixClientPeg {
|
||||||
opts.pendingEventOrdering = "detached";
|
opts.pendingEventOrdering = "detached";
|
||||||
|
|
||||||
if (SettingsStore.isFeatureEnabled('feature_lazyloading')) {
|
if (SettingsStore.isFeatureEnabled('feature_lazyloading')) {
|
||||||
opts.filter = await this.matrixClient.createFilter(FILTER_CONTENT);
|
opts.lazyLoadMembers = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -127,7 +119,7 @@ class MatrixClientPeg {
|
||||||
MatrixActionCreators.start(this.matrixClient);
|
MatrixActionCreators.start(this.matrixClient);
|
||||||
|
|
||||||
console.log(`MatrixClientPeg: really starting MatrixClient`);
|
console.log(`MatrixClientPeg: really starting MatrixClient`);
|
||||||
this.get().startClient(opts);
|
await this.get().startClient(opts);
|
||||||
console.log(`MatrixClientPeg: MatrixClient started`);
|
console.log(`MatrixClientPeg: MatrixClient started`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,9 @@ const Pill = React.createClass({
|
||||||
getContent: () => {
|
getContent: () => {
|
||||||
return {avatar_url: resp.avatar_url};
|
return {avatar_url: resp.avatar_url};
|
||||||
},
|
},
|
||||||
|
getDirectionalContent: function() {
|
||||||
|
return this.getContent();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
this.setState({member});
|
this.setState({member});
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
|
|
Loading…
Reference in a new issue