From 65bdaa20b02487a494aee7a85e0681550a5bc84d Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 29 Apr 2020 15:19:09 +0100 Subject: [PATCH] Allow resetting storage from the access dialog This adds a path to reset secret storage from the access dialog instead of throwing an error. Fixes https://github.com/vector-im/riot-web/issues/13436 --- .../views/dialogs/secretstorage/AccessSecretStorageDialog.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js b/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js index 7d7edffcbf..e2ceadfbb9 100644 --- a/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js +++ b/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js @@ -21,6 +21,7 @@ import * as sdk from '../../../../index'; import {MatrixClientPeg} from '../../../../MatrixClientPeg'; import { _t } from '../../../../languageHandler'; +import { accessSecretStorage } from '../../../../CrossSigningManager'; /* * Access Secure Secret Storage by requesting the user's passphrase. @@ -55,8 +56,9 @@ export default class AccessSecretStorageDialog extends React.PureComponent { } _onResetRecoveryClick = () => { + // Re-enter the access flow, but resetting storage this time around. this.props.onFinished(false); - throw new Error("Resetting secret storage unimplemented"); + accessSecretStorage(() => {}, /* forceReset = */ true); } _onRecoveryKeyChange = (e) => {