From 27bb67bac5d33cf26ef678b046f6408d8d021089 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 13 Oct 2023 11:39:55 +0100 Subject: [PATCH] Consolidate 4s passphrase input fields and use stable IDs (#11743) * Reuse PassphraseConfirmField for create 4s flow Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Use stable ID on 4s phrase fields Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Pass autoFocus prop to PassphraseConfirmField Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update stable ID Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Add missing labels Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../dialogs/security/CreateSecretStorageDialog.tsx | 12 ++++++++---- src/components/views/auth/PassphraseConfirmField.tsx | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index 780d304249..036fb5038b 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -48,6 +48,7 @@ import Spinner from "../../../../components/views/elements/Spinner"; import InteractiveAuthDialog from "../../../../components/views/dialogs/InteractiveAuthDialog"; import { IValidationResult } from "../../../../components/views/elements/Validation"; import { Icon as CheckmarkIcon } from "../../../../../res/img/element-icons/check.svg"; +import PassphraseConfirmField from "../../../../components/views/auth/PassphraseConfirmField"; // I made a mistake while converting this and it has to be fixed! enum Phase { @@ -649,6 +650,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent

{_t("settings|key_backup|setup_secure_backup|enter_phrase_to_confirm")}

-
{passPhraseMatch}
diff --git a/src/components/views/auth/PassphraseConfirmField.tsx b/src/components/views/auth/PassphraseConfirmField.tsx index 8bb6cac8d2..794df041c8 100644 --- a/src/components/views/auth/PassphraseConfirmField.tsx +++ b/src/components/views/auth/PassphraseConfirmField.tsx @@ -77,6 +77,7 @@ class PassphraseConfirmField extends PureComponent { value={this.props.value} onChange={this.props.onChange} onValidate={this.onValidate} + autoFocus={this.props.autoFocus} /> ); }