From 920daa3125c229697a25daa65788d909839c71e1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 29 Jan 2020 13:43:08 +0000 Subject: [PATCH] Get rid of custom enter handling and protect handlers, disabling button isn't foolproof Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/dialogs/keybackup/RestoreKeyBackupDialog.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js index 814f5a4980..fc9a21c51b 100644 --- a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js +++ b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js @@ -22,7 +22,6 @@ import {MatrixClientPeg} from '../../../../MatrixClientPeg'; import { MatrixClient } from 'matrix-js-sdk'; import Modal from '../../../../Modal'; import { _t } from '../../../../languageHandler'; -import {Key} from "../../../../Keyboard"; import { accessSecretStorage } from '../../../../CrossSigningManager'; const RESTORE_TYPE_PASSPHRASE = 0; @@ -125,6 +124,8 @@ export default class RestoreKeyBackupDialog extends React.PureComponent { } _onRecoveryKeyNext = async () => { + if (!this.state.recoveryKeyValid) return; + this.setState({ loading: true, restoreError: null, @@ -157,12 +158,6 @@ export default class RestoreKeyBackupDialog extends React.PureComponent { }); } - _onRecoveryKeyKeyPress = (e) => { - if (e.key === Key.ENTER && this.state.recoveryKeyValid) { - this._onRecoveryKeyNext(); - } - } - async _restoreWithSecretStorage() { this.setState({ loading: true, @@ -366,7 +361,6 @@ export default class RestoreKeyBackupDialog extends React.PureComponent {