Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

remove ll feature flag, it's time! #2588

Merged
merged 5 commits into from
Feb 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/MatrixClientPeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,7 @@ class MatrixClientPeg {
const opts = utils.deepCopy(this.opts);
// the react sdk doesn't work without this, so don't allow
opts.pendingEventOrdering = "detached";

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;
}
}
opts.lazyLoadMembers = true;

// Connect the matrix client to the dispatcher
MatrixActionCreators.start(this.matrixClient);
Expand Down
33 changes: 0 additions & 33 deletions src/components/views/settings/tabs/LabsSettingsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,15 @@ import React from 'react';
import {_t} from "../../../../languageHandler";
import PropTypes from "prop-types";
import SettingsStore, {SettingLevel} from "../../../../settings/SettingsStore";
import MatrixClientPeg from "../../../../MatrixClientPeg";
import LabelledToggleSwitch from "../../elements/LabelledToggleSwitch";
const Modal = require("../../../../Modal");
const sdk = require("../../../../index");

export class LabsSettingToggle extends React.Component {
static propTypes = {
featureId: PropTypes.string.isRequired,
};

async _onLazyLoadChanging(enabling) {
// don't prevent turning LL off when not supported
if (enabling) {
const supported = await MatrixClientPeg.get().doesServerSupportLazyLoading();
if (!supported) {
await new Promise((resolve) => {
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
Modal.createDialog(QuestionDialog, {
title: _t("Lazy loading members not supported"),
description:
<div>
{ _t("Lazy loading is not supported by your " +
"current homeserver.") }
</div>,
button: _t("OK"),
onFinished: resolve,
});
});
return false;
}
}
return true;
}

_onChange = async (checked) => {
if (this.props.featureId === "feature_lazyloading") {
const confirmed = await this._onLazyLoadChanging(checked);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're dropping the homeserver check, please also delete the function above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

if (!confirmed) {
return;
}
}

await SettingsStore.setFeatureEnabled(this.props.featureId, checked);
this.forceUpdate();
};
Expand Down
3 changes: 0 additions & 3 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@
"Failed to join room": "Failed to join room",
"Message Pinning": "Message Pinning",
"Custom user status messages": "Custom user status messages",
"Increase performance by only loading room members on first view": "Increase performance by only loading room members on first view",
"Backup of encryption keys to server": "Backup of encryption keys to server",
"Render simple counters in room header": "Render simple counters in room header",
"Two-way device verification using short text": "Two-way device verification using short text",
Expand Down Expand Up @@ -476,8 +475,6 @@
"Identity Server is": "Identity Server is",
"Access Token:": "Access Token:",
"click to reveal": "click to reveal",
"Lazy loading members not supported": "Lazy loading members not supported",
"Lazy loading is not supported by your current homeserver.": "Lazy loading is not supported by your current homeserver.",
"Labs": "Labs",
"Notifications": "Notifications",
"Start automatically after system login": "Start automatically after system login",
Expand Down
8 changes: 0 additions & 8 deletions src/settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
NotificationBodyEnabledController,
NotificationsEnabledController,
} from "./controllers/NotificationControllers";
import LazyLoadingController from "./controllers/LazyLoadingController";
import CustomStatusController from "./controllers/CustomStatusController";

// These are just a bunch of helper arrays to avoid copy/pasting a bunch of times
Expand Down Expand Up @@ -100,13 +99,6 @@ export const SETTINGS = {
default: false,
controller: new CustomStatusController(),
},
"feature_lazyloading": {
isFeature: true,
displayName: _td("Increase performance by only loading room members on first view"),
supportedLevels: LEVELS_FEATURE,
controller: new LazyLoadingController(),
default: true,
},
"feature_keybackup": {
isFeature: true,
displayName: _td("Backup of encryption keys to server"),
Expand Down
29 changes: 0 additions & 29 deletions src/settings/controllers/LazyLoadingController.js

This file was deleted.