Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated MatrixClient.keyBackupKeyFromPassword call. #28233

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading