mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Move LL filter creation inside MatrixClient
As we need an option to turn lazy loading on (we can't just accept a filter, as /messages has an incompatible filter), better only pass the option and create the filter inside startClient
This commit is contained in:
parent
e1843601be
commit
42fc83d2a8
1 changed files with 1 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.
|
||||||
|
@ -109,7 +101,6 @@ class MatrixClientPeg {
|
||||||
|
|
||||||
if (SettingsStore.isFeatureEnabled('feature_lazyloading')) {
|
if (SettingsStore.isFeatureEnabled('feature_lazyloading')) {
|
||||||
opts.lazyLoadMembers = true;
|
opts.lazyLoadMembers = true;
|
||||||
opts.filter = await this.matrixClient.createFilter(FILTER_CONTENT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -128,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`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue