diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js
index 701247bd8b..a5ba4ff0fa 100644
--- a/src/components/structures/UserSettings.js
+++ b/src/components/structures/UserSettings.js
@@ -845,7 +845,15 @@ module.exports = React.createClass({
// TODO: this ought to be a separate component so that we don't need
// to rebind the onChange each time we render
const onChange = async (e) => {
- await SettingsStore.setFeatureEnabled(featureId, e.target.checked);
+ const checked = e.target.checked;
+ if (featureId === "feature_lazyloading") {
+ const confirmed = await this._onLazyLoadChanging();
+ if (!confirmed) {
+ e.preventDefault();
+ return;
+ }
+ }
+ await SettingsStore.setFeatureEnabled(featureId, checked);
this.forceUpdate();
};
@@ -878,6 +886,31 @@ module.exports = React.createClass({
);
},
+ _onLazyLoadChanging: function() {
+ return new Promise((resolve) => {
+ const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
+ Modal.createDialog(QuestionDialog, {
+ title: _t("Turn on/off lazy load members"),
+ description:
+
+ { _t("To enable or disable the lazy loading of members, " +
+ "the current synced state needs to be cleared out. " +
+ "This also includes your end-to-end encryption keys, " +
+ "so to keep being able to decrypt all your existing encrypted messages, " +
+ "you'll need to export your E2E room keys and import them again afterwards.") }
+
- { _t("To enable or disable the lazy loading of members, " +
- "the current synced state needs to be cleared out. " +
- "This also includes your end-to-end encryption keys, " +
- "so to keep being able to decrypt all your existing encrypted messages, " +
- "you'll need to export your E2E room keys and import them again afterwards.") }
-
,
- button: _t("Clear sync state and reload"),
- extraButtons: [
- ,
- ],
- onFinished,
- });
- }
-
- _onExportE2eKeysClicked() {
- Modal.createTrackedDialogAsync('Export E2E Keys', '', (cb) => {
- require.ensure(['../../async-components/views/dialogs/ExportE2eKeysDialog'], () => {
- cb(require('../../async-components/views/dialogs/ExportE2eKeysDialog'));
- }, "e2e-export");
- }, {
- matrixClient: MatrixClientPeg.get(),
- });
- }
}
diff --git a/src/settings/controllers/SettingController.js b/src/settings/controllers/SettingController.js
index 6b09c4fc53..9dcb6259b5 100644
--- a/src/settings/controllers/SettingController.js
+++ b/src/settings/controllers/SettingController.js
@@ -38,11 +38,6 @@ export default class SettingController {
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
return null; // no override
}
-
- canChangeTo(level, roomId, newValue) {
- return Promise.resolve(true);
- }
-
/**
* Called when the setting value has been changed.
* @param {string} level The level at which the setting has been modified.