Skip to content

Commit

Permalink
- Remove deprecated MatrixClient.keyBackupKeyFromPassword call.
Browse files Browse the repository at this point in the history
- The `keyBackupKeyFromPassword` call is bound to the `keyCallback` props in `RestoreKeyBackupDialog` which is not used in `CreateSecretStorageDialog`
- Remove code bound to `keyCallback` props
  • Loading branch information
florianduros committed Oct 18, 2024
1 parent 85d2bf3 commit b636f02
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 0 additions & 14 deletions src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ describe("CreateSecretStorageDialog", () => {
expect(modalSpy).toHaveBeenCalledWith(
RestoreKeyBackupDialog,
{
keyCallback: expect.any(Function),
showSummary: false,
},
undefined,
Expand Down Expand Up @@ -200,7 +199,6 @@ describe("CreateSecretStorageDialog", () => {
expect(modalSpy).toHaveBeenCalledWith(
RestoreKeyBackupDialog,
{
keyCallback: expect.any(Function),
showSummary: false,
},
undefined,
Expand Down

0 comments on commit b636f02

Please sign in to comment.