mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 12:45:11 +08:00
- Remove deprecated MatrixClient.keyBackupKeyFromPassword
call. (#28233)
- The `keyBackupKeyFromPassword` call is bound to the `keyCallback` props in `RestoreKeyBackupDialog` which is not used in `CreateSecretStorageDialog` - Remove code bound to `keyCallback` props
This commit is contained in:
parent
3294c6b5c5
commit
061c8217b3
@ -404,13 +404,10 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
|
||||
};
|
||||
|
||||
private restoreBackup = async (): Promise<void> => {
|
||||
const keyCallback = (k: Uint8Array): void => {};
|
||||
|
||||
const { finished } = Modal.createDialog(
|
||||
RestoreKeyBackupDialog,
|
||||
{
|
||||
showSummary: false,
|
||||
keyCallback,
|
||||
},
|
||||
undefined,
|
||||
/* priority = */ false,
|
||||
|
@ -37,9 +37,6 @@ interface IProps {
|
||||
// if false, will close the dialog as soon as the restore completes successfully
|
||||
// default: true
|
||||
showSummary?: boolean;
|
||||
// If specified, gather the key from the user but then call the function with the backup
|
||||
// key rather than actually (necessarily) restoring the backup.
|
||||
keyCallback?: (key: Uint8Array) => void;
|
||||
onFinished(done?: boolean): void;
|
||||
}
|
||||
|
||||
@ -156,13 +153,6 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
||||
this.state.backupInfo,
|
||||
{ progressCallback: this.progressCallback },
|
||||
);
|
||||
if (this.props.keyCallback) {
|
||||
const key = await MatrixClientPeg.safeGet().keyBackupKeyFromPassword(
|
||||
this.state.passPhrase,
|
||||
this.state.backupInfo,
|
||||
);
|
||||
this.props.keyCallback(key);
|
||||
}
|
||||
|
||||
if (!this.props.showSummary) {
|
||||
this.props.onFinished(true);
|
||||
@ -197,10 +187,6 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
||||
this.state.backupInfo,
|
||||
{ progressCallback: this.progressCallback },
|
||||
);
|
||||
if (this.props.keyCallback) {
|
||||
const key = decodeRecoveryKey(this.state.recoveryKey);
|
||||
this.props.keyCallback(key);
|
||||
}
|
||||
if (!this.props.showSummary) {
|
||||
this.props.onFinished(true);
|
||||
return;
|
||||
|
@ -122,7 +122,6 @@ describe("CreateSecretStorageDialog", () => {
|
||||
expect(modalSpy).toHaveBeenCalledWith(
|
||||
RestoreKeyBackupDialog,
|
||||
{
|
||||
keyCallback: expect.any(Function),
|
||||
showSummary: false,
|
||||
},
|
||||
undefined,
|
||||
@ -200,7 +199,6 @@ describe("CreateSecretStorageDialog", () => {
|
||||
expect(modalSpy).toHaveBeenCalledWith(
|
||||
RestoreKeyBackupDialog,
|
||||
{
|
||||
keyCallback: expect.any(Function),
|
||||
showSummary: false,
|
||||
},
|
||||
undefined,
|
||||
|
Loading…
Reference in New Issue
Block a user