diff --git a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js index f1008dfcb0..7e51e76f6c 100644 --- a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js +++ b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js @@ -23,6 +23,7 @@ import { MatrixClient } from 'matrix-js-sdk'; import Modal from '../../../../Modal'; import { _t } from '../../../../languageHandler'; import { accessSecretStorage } from '../../../../CrossSigningManager'; +import SettingsStore from "../../../../settings/SettingsStore"; const RESTORE_TYPE_PASSPHRASE = 0; const RESTORE_TYPE_RECOVERYKEY = 1; @@ -89,14 +90,21 @@ export default class RestoreKeyBackupDialog extends React.PureComponent { _onResetRecoveryClick = () => { this.props.onFinished(false); - Modal.createTrackedDialogAsync('Key Backup', 'Key Backup', - import('../../../../async-components/views/dialogs/keybackup/CreateKeyBackupDialog'), - { - onFinished: () => { - this._loadBackupStatus(); - }, - }, null, /* priority = */ false, /* static = */ true, - ); + + if (SettingsStore.getValue("feature_cross_signing")) { + // If cross-signing is enabled, we reset the SSSS recovery passphrase (and cross-signing keys) + this.props.onFinished(false); + accessSecretStorage(() => {}, /* forceReset = */ true); + } else { + Modal.createTrackedDialogAsync('Key Backup', 'Key Backup', + import('../../../../async-components/views/dialogs/keybackup/CreateKeyBackupDialog'), + { + onFinished: () => { + this._loadBackupStatus(); + }, + }, null, /* priority = */ false, /* static = */ true, + ); + } } _onRecoveryKeyChange = (e) => {