Merge pull request #4569 from matrix-org/dbkr/key_backup_restore_reset_recovery
Fix passphrase reset in key backup restore dialogpull/21833/head
commit
03fce86699
|
@ -23,6 +23,7 @@ import { MatrixClient } from 'matrix-js-sdk';
|
||||||
import Modal from '../../../../Modal';
|
import Modal from '../../../../Modal';
|
||||||
import { _t } from '../../../../languageHandler';
|
import { _t } from '../../../../languageHandler';
|
||||||
import { accessSecretStorage } from '../../../../CrossSigningManager';
|
import { accessSecretStorage } from '../../../../CrossSigningManager';
|
||||||
|
import SettingsStore from "../../../../settings/SettingsStore";
|
||||||
|
|
||||||
const RESTORE_TYPE_PASSPHRASE = 0;
|
const RESTORE_TYPE_PASSPHRASE = 0;
|
||||||
const RESTORE_TYPE_RECOVERYKEY = 1;
|
const RESTORE_TYPE_RECOVERYKEY = 1;
|
||||||
|
@ -89,6 +90,12 @@ export default class RestoreKeyBackupDialog extends React.PureComponent {
|
||||||
|
|
||||||
_onResetRecoveryClick = () => {
|
_onResetRecoveryClick = () => {
|
||||||
this.props.onFinished(false);
|
this.props.onFinished(false);
|
||||||
|
|
||||||
|
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',
|
Modal.createTrackedDialogAsync('Key Backup', 'Key Backup',
|
||||||
import('../../../../async-components/views/dialogs/keybackup/CreateKeyBackupDialog'),
|
import('../../../../async-components/views/dialogs/keybackup/CreateKeyBackupDialog'),
|
||||||
{
|
{
|
||||||
|
@ -98,6 +105,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent {
|
||||||
}, null, /* priority = */ false, /* static = */ true,
|
}, null, /* priority = */ false, /* static = */ true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_onRecoveryKeyChange = (e) => {
|
_onRecoveryKeyChange = (e) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
Loading…
Reference in New Issue