You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Avoid clearing e2e encryption keys, also avoid warning
This commit is contained in:
@ -887,12 +887,12 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_onLazyLoadChanging: async function(enabling) {
|
_onLazyLoadChanging: async function(enabling) {
|
||||||
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
|
||||||
// don't prevent turning LL off when not supported
|
// don't prevent turning LL off when not supported
|
||||||
if (enabling) {
|
if (enabling) {
|
||||||
const supported = await MatrixClientPeg.get().doesServerSupportLazyLoading();
|
const supported = await MatrixClientPeg.get().doesServerSupportLazyLoading();
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
|
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
Modal.createDialog(QuestionDialog, {
|
Modal.createDialog(QuestionDialog, {
|
||||||
title: _t("Lazy loading members not supported"),
|
title: _t("Lazy loading members not supported"),
|
||||||
description:
|
description:
|
||||||
@ -907,28 +907,7 @@ module.exports = React.createClass({
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const confirmed = await new Promise((resolve) => {
|
return true;
|
||||||
Modal.createDialog(QuestionDialog, {
|
|
||||||
title: _t("Turn on/off lazy load members"),
|
|
||||||
description:
|
|
||||||
<div>
|
|
||||||
{ _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.") }
|
|
||||||
</div>,
|
|
||||||
button: _t("Clear sync state and reload"),
|
|
||||||
extraButtons: [
|
|
||||||
<button key="export" className="mx_Dialog_primary"
|
|
||||||
onClick={this._onExportE2eKeysClicked}>
|
|
||||||
{ _t("Export E2E room keys") }
|
|
||||||
</button>,
|
|
||||||
],
|
|
||||||
onFinished: resolve,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return confirmed;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_renderDeactivateAccount: function() {
|
_renderDeactivateAccount: function() {
|
||||||
|
@ -1218,9 +1218,6 @@
|
|||||||
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
|
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
|
||||||
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
|
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
|
||||||
"Increase performance by only loading room members on first view": "Increase performance by only loading room members on first view",
|
"Increase performance by only loading room members on first view": "Increase performance by only loading room members on first view",
|
||||||
"Turn on/off lazy load members": "Turn on/off lazy load members",
|
|
||||||
"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.": "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.",
|
|
||||||
"Clear sync state and reload": "Clear sync state and reload",
|
|
||||||
"Lazy loading members not supported": "Lazy load members not supported",
|
"Lazy loading members not supported": "Lazy load members not supported",
|
||||||
"Lazy loading is not supported by your current homeserver.": "Lazy loading is not supported by your current homeserver."
|
"Lazy loading is not supported by your current homeserver.": "Lazy loading is not supported by your current homeserver."
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,15 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import SettingController from "./SettingController";
|
import SettingController from "./SettingController";
|
||||||
import dis from "../../dispatcher";
|
import MatrixClientPeg from "../../MatrixClientPeg";
|
||||||
|
import PlatformPeg from "../../PlatformPeg";
|
||||||
|
|
||||||
export default class LazyLoadingController extends SettingController {
|
export default class LazyLoadingController extends SettingController {
|
||||||
onChange(level, roomId, newValue) {
|
async onChange(level, roomId, newValue) {
|
||||||
dis.dispatch({action: 'flush_storage_reload'});
|
if (!PlatformPeg.get()) return;
|
||||||
|
|
||||||
|
MatrixClientPeg.get().stopClient();
|
||||||
|
await MatrixClientPeg.get().store.deleteAllData();
|
||||||
|
PlatformPeg.get().reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user