From ef204b6e99b2cbd253c71fe00781c287796db459 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 15 Oct 2018 16:41:24 +0200 Subject: [PATCH] check if phased rollout has expired before trying to enable LL --- src/MatrixClientPeg.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index f02c751a2c..04b3b47e43 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -26,6 +26,7 @@ import EventTimelineSet from 'matrix-js-sdk/lib/models/event-timeline-set'; import createMatrixClient from './utils/createMatrixClient'; import SettingsStore from './settings/SettingsStore'; import MatrixActionCreators from './actions/MatrixActionCreators'; +import {phasedRollOutExpiredForUser} from "./PhasedRollOut"; interface MatrixClientCreds { homeserverUrl: string, @@ -124,8 +125,12 @@ class MatrixClientPeg { // the react sdk doesn't work without this, so don't allow opts.pendingEventOrdering = "detached"; - if (SettingsStore.isFeatureEnabled('feature_lazyloading')) { - opts.lazyLoadMembers = true; + const LAZY_LOADING_FEATURE = "feature_lazyloading"; + if (SettingsStore.isFeatureEnabled(LAZY_LOADING_FEATURE)) { + const userId = this.matrixClient.credentials.userId; + if (phasedRollOutExpiredForUser(userId, LAZY_LOADING_FEATURE, Date.now())) { + opts.lazyLoadMembers = true; + } } // Connect the matrix client to the dispatcher