From def0a24feaa70ae6a1e08c3ae50777aabdd5f882 Mon Sep 17 00:00:00 2001 From: Philipp von Weitershausen Date: Thu, 3 Feb 2011 10:54:00 -0800 Subject: [PATCH] Bug 630885 - Sync key listed as undefined and generates an error on 'Change Sync Key'. r=mconnor a=blocking-final Don't make the user click on "Generate" before the 'Change Sync Key' dialog can be dismissed. --- browser/base/content/syncGenericChange.js | 4 ++++ browser/base/content/syncSetup.js | 2 +- browser/base/content/syncUtils.js | 9 +++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/browser/base/content/syncGenericChange.js b/browser/base/content/syncGenericChange.js index 71ba2ffc0c1..2cd16f6c3e3 100644 --- a/browser/base/content/syncGenericChange.js +++ b/browser/base/content/syncGenericChange.js @@ -73,6 +73,7 @@ let Change = { // load some other elements & info from the window this._dialog = document.getElementById("change-dialog"); this._dialogType = window.arguments[0]; + this._duringSetup = window.arguments[1]; this._status = document.getElementById("status"); this._statusIcon = document.getElementById("statusIcon"); this._statusRow = document.getElementById("statusRow"); @@ -115,6 +116,9 @@ let Change = { warningText.textContent = this._str("change.synckey2.warningText"); this._dialog.getButton("finish").label = this._str("change.synckey.acceptButton"); + if (this._duringSetup) { + this._dialog.getButton("finish").disabled = false; + } } break; case "ChangePassword": diff --git a/browser/base/content/syncSetup.js b/browser/base/content/syncSetup.js index cef787940f9..514d2d6f99a 100644 --- a/browser/base/content/syncSetup.js +++ b/browser/base/content/syncSetup.js @@ -174,7 +174,7 @@ var gSyncSetup = { // according to the user's pref. Weave.Svc.Prefs.reset("firstSync"); this.setupInitialSync(); - gSyncUtils.resetPassphrase(); + gSyncUtils.resetPassphrase(true); }, onResetPassphrase: function () { diff --git a/browser/base/content/syncUtils.js b/browser/base/content/syncUtils.js index 01b07315ed1..e331f437dfb 100644 --- a/browser/base/content/syncUtils.js +++ b/browser/base/content/syncUtils.js @@ -67,7 +67,7 @@ let gSyncUtils = { input.value = Weave.Clients.localName; }, - openChange: function openChange(type) { + openChange: function openChange(type, duringSetup) { // Just re-show the dialog if it's already open let openedDialog = Weave.Svc.WinMediator.getMostRecentWindow("Sync:" + type); if (openedDialog != null) { @@ -78,7 +78,8 @@ let gSyncUtils = { // Open up the change dialog let changeXUL = "chrome://browser/content/syncGenericChange.xul"; let changeOpt = "centerscreen,chrome,resizable=no"; - Weave.Svc.WinWatcher.activeWindow.openDialog(changeXUL, "", changeOpt, type); + Weave.Svc.WinWatcher.activeWindow.openDialog(changeXUL, "", changeOpt, + type, duringSetup); }, changePassword: function () { @@ -86,9 +87,9 @@ let gSyncUtils = { this.openChange("ChangePassword"); }, - resetPassphrase: function () { + resetPassphrase: function (duringSetup) { if (Weave.Utils.ensureMPUnlocked()) - this.openChange("ResetPassphrase"); + this.openChange("ResetPassphrase", duringSetup); }, updatePassphrase: function () {