diff --git a/browser/base/content/syncSetup.js b/browser/base/content/syncSetup.js index 715f612a3a9..3f12cce20ef 100644 --- a/browser/base/content/syncSetup.js +++ b/browser/base/content/syncSetup.js @@ -341,7 +341,7 @@ var gSyncSetup = { // xxxmpc - hack, sigh if (el1.value == document.getElementById("weavePassword").value) { valid = false; - str = Weave.Utils.getErrorString("change.passphrase.ppSameAsPassword"); + str = Weave.Utils.getErrorString("change.synckey.sameAsPassword"); } else { [valid, str] = gSyncUtils.validatePassphrase(el1); @@ -349,8 +349,11 @@ var gSyncSetup = { let feedback = document.getElementById("passphraseFeedbackRow"); this._setFeedback(feedback, valid, str); - if (!valid) + if (!valid) { + // Hide strength meter if we're displaying an error. + document.getElementById("passphraseStrengthRow").hidden = true; return valid; + } // No passphrase strength meter for the generated key. if (!this._haveCustomSyncKey) diff --git a/browser/base/content/syncUtils.js b/browser/base/content/syncUtils.js index b802cf7138f..469f19efb35 100644 --- a/browser/base/content/syncUtils.js +++ b/browser/base/content/syncUtils.js @@ -299,7 +299,9 @@ let gSyncUtils = { let val = el.value; let error = ""; - if (val == Weave.Service.username) + if (val.length < Weave.MIN_PP_LENGTH) + error = "change.synckey.tooShort"; + else if (val == Weave.Service.username) error = "change.synckey.sameAsUsername"; else if (val == Weave.Service.account) error = "change.synckey.sameAsEmail"; @@ -307,8 +309,6 @@ let gSyncUtils = { error = "change.synckey.sameAsPassword"; else if (change && val == Weave.Service.passphrase) error = "change.synckey.sameAsSyncKey"; - else if (val.length < Weave.MIN_PP_LENGTH) - error = "change.synckey.tooShort"; else valid = true;