From b636f02369f63dc05ee58e6088d85c372afb2900 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Fri, 18 Oct 2024 11:39:48 +0200 Subject: [PATCH] - Remove deprecated `MatrixClient.keyBackupKeyFromPassword` call. - The `keyBackupKeyFromPassword` call is bound to the `keyCallback` props in `RestoreKeyBackupDialog` which is not used in `CreateSecretStorageDialog` - Remove code bound to `keyCallback` props --- .../dialogs/security/CreateSecretStorageDialog.tsx | 3 --- .../dialogs/security/RestoreKeyBackupDialog.tsx | 14 -------------- .../security/CreateSecretStorageDialog-test.tsx | 2 -- 3 files changed, 19 deletions(-) diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index 441f217be9b..2278fb38060 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -404,13 +404,10 @@ export default class CreateSecretStorageDialog extends React.PureComponent => { - const keyCallback = (k: Uint8Array): void => {}; - const { finished } = Modal.createDialog( RestoreKeyBackupDialog, { showSummary: false, - keyCallback, }, undefined, /* priority = */ false, diff --git a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx index 442251d2997..21416a36636 100644 --- a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx +++ b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx @@ -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 { 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,