Update confirm passphrase copy

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-05-25 11:35:21 +01:00
parent 37d04d6ceb
commit c73c3ae927
3 changed files with 9 additions and 2 deletions

View File

@ -284,8 +284,10 @@ export default class CreateKeyBackupDialog extends React.PureComponent {
const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
let matchText; let matchText;
let changeText;
if (this.state.passPhraseConfirm === this.state.passPhrase) { if (this.state.passPhraseConfirm === this.state.passPhrase) {
matchText = _t("That matches!"); matchText = _t("That matches!");
changeText = _t("Use a different passphrase?");
} else if (!this.state.passPhrase.startsWith(this.state.passPhraseConfirm)) { } else if (!this.state.passPhrase.startsWith(this.state.passPhraseConfirm)) {
// only tell them they're wrong if they've actually gone wrong. // only tell them they're wrong if they've actually gone wrong.
// Security concious readers will note that if you left riot-web unattended // Security concious readers will note that if you left riot-web unattended
@ -295,6 +297,7 @@ export default class CreateKeyBackupDialog extends React.PureComponent {
// Note that not having typed anything at all will not hit this clause and // Note that not having typed anything at all will not hit this clause and
// fall through so empty box === no hint. // fall through so empty box === no hint.
matchText = _t("That doesn't match."); matchText = _t("That doesn't match.");
changeText = _t("Go back to set it again.");
} }
let passPhraseMatch = null; let passPhraseMatch = null;
@ -303,7 +306,7 @@ export default class CreateKeyBackupDialog extends React.PureComponent {
<div>{matchText}</div> <div>{matchText}</div>
<div> <div>
<AccessibleButton element="span" className="mx_linkButton" onClick={this._onSetAgainClick}> <AccessibleButton element="span" className="mx_linkButton" onClick={this._onSetAgainClick}>
{_t("Go back to set it again.")} {changeText}
</AccessibleButton> </AccessibleButton>
</div> </div>
</div>; </div>;

View File

@ -538,8 +538,10 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
const Field = sdk.getComponent('views.elements.Field'); const Field = sdk.getComponent('views.elements.Field');
let matchText; let matchText;
let changeText;
if (this.state.passPhraseConfirm === this.state.passPhrase) { if (this.state.passPhraseConfirm === this.state.passPhrase) {
matchText = _t("That matches!"); matchText = _t("That matches!");
changeText = _t("Use a different passphrase?");
} else if (!this.state.passPhrase.startsWith(this.state.passPhraseConfirm)) { } else if (!this.state.passPhrase.startsWith(this.state.passPhraseConfirm)) {
// only tell them they're wrong if they've actually gone wrong. // only tell them they're wrong if they've actually gone wrong.
// Security concious readers will note that if you left riot-web unattended // Security concious readers will note that if you left riot-web unattended
@ -549,6 +551,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
// Note that not having typed anything at all will not hit this clause and // Note that not having typed anything at all will not hit this clause and
// fall through so empty box === no hint. // fall through so empty box === no hint.
matchText = _t("That doesn't match."); matchText = _t("That doesn't match.");
changeText = _t("Go back to set it again.");
} }
let passPhraseMatch = null; let passPhraseMatch = null;
@ -557,7 +560,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
<div>{matchText}</div> <div>{matchText}</div>
<div> <div>
<AccessibleButton element="span" className="mx_linkButton" onClick={this._onSetAgainClick}> <AccessibleButton element="span" className="mx_linkButton" onClick={this._onSetAgainClick}>
{_t("Go back to set it again.")} {changeText}
</AccessibleButton> </AccessibleButton>
</div> </div>
</div>; </div>;

View File

@ -2217,6 +2217,7 @@
"Back up encrypted message keys": "Back up encrypted message keys", "Back up encrypted message keys": "Back up encrypted message keys",
"Set up with a recovery key": "Set up with a recovery key", "Set up with a recovery key": "Set up with a recovery key",
"That matches!": "That matches!", "That matches!": "That matches!",
"Use a different passphrase?": "Use a different passphrase?",
"That doesn't match.": "That doesn't match.", "That doesn't match.": "That doesn't match.",
"Go back to set it again.": "Go back to set it again.", "Go back to set it again.": "Go back to set it again.",
"Enter your recovery passphrase a second time to confirm it.": "Enter your recovery passphrase a second time to confirm it.", "Enter your recovery passphrase a second time to confirm it.": "Enter your recovery passphrase a second time to confirm it.",