hide lazy loading behind feature flag

This commit is contained in:
Bruno Windels 2018-07-16 15:07:53 +02:00
parent 866b4bb067
commit af07d73432
3 changed files with 13 additions and 2 deletions

View file

@ -107,7 +107,9 @@ class MatrixClientPeg {
// the react sdk doesn't work without this, so don't allow
opts.pendingEventOrdering = "detached";
if (SettingsStore.isFeatureEnabled('feature_lazyloading')) {
opts.filter = await this.matrixClient.createFilter(FILTER_CONTENT);
}
try {
const promise = this.matrixClient.store.startup();

View file

@ -314,9 +314,13 @@ module.exports = React.createClass({
this.setState({isPeeking: false});
//viewing a previously joined room, try to lazy load members
// lazy load members if enabled
if (SettingsStore.isFeatureEnabled('feature_lazyloading')) {
MatrixClientPeg.get().loadRoomMembersIfNeeded(room.roomId);
}
}
}
},
_shouldShowApps: function(room) {

View file

@ -83,6 +83,11 @@ export const SETTINGS = {
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_lazyloading": {
isFeature: true,
displayName: _td("Increase performance by loading room members on first view"),
supportedLevels: LEVELS_FEATURE,
},
"MessageComposerInput.dontSuggestEmoji": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Disable Emoji suggestions while typing'),