From 42fc83d2a84ddd3ce7919b37627cda1b9ea6117f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 2 Aug 2018 19:38:41 +0200 Subject: [PATCH] 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 --- src/MatrixClientPeg.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index e8ef689294..f5872812de 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -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`); }