diff --git a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js index 64aff467a7..4f0db1eebe 100644 --- a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js +++ b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js @@ -453,14 +453,19 @@ export default class CreateSecretStorageDialog extends React.PureComponent { if (this.state.zxcvbnResult.score >= PASSWORD_MIN_SCORE) { helpText = _t("Great! This passphrase looks strong enough."); } else { - const suggestions = []; - for (let i = 0; i < this.state.zxcvbnResult.feedback.suggestions.length; ++i) { - suggestions.push(
{this.state.zxcvbnResult.feedback.suggestions[i]}
); - } - const suggestionBlock =
{suggestions.length > 0 ? suggestions : _t("Keep going...")}
; + // We take the warning from zxcvbn or failing that, the first + // suggestion. In practice The first is generally the most relevant + // and it's probably better to present the user with one thing to + // improve about their password than a whole collection - it can + // spit out a warning and multiple suggestions which starts getting + // very information-dense. + const suggestion = ( + this.state.zxcvbnResult.feedback.warning || + this.state.zxcvbnResult.feedback.suggestions[0] + ); + const suggestionBlock =
{suggestion || _t("Keep going...")}
; helpText =
- {this.state.zxcvbnResult.feedback.warning} {suggestionBlock}
; }