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:
Bruno Windels 2018-08-02 19:38:41 +02:00
parent e1843601be
commit 42fc83d2a8

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.
@ -109,7 +101,6 @@ class MatrixClientPeg {
if (SettingsStore.isFeatureEnabled('feature_lazyloading')) {
opts.lazyLoadMembers = true;
opts.filter = await this.matrixClient.createFilter(FILTER_CONTENT);
}
try {
@ -128,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`);
}