Bug 962729 - Sync toolbar button and menu item need to open the prefs dialog when logged in r=markh
authorTim Taubert <ttaubert@mozilla.com>
Wed, 22 Jan 2014 20:53:58 +0100
changeset 164960 f5ac964a5264121e38e78733c74789076762dc42
parent 164959 720e5175441329135afc892cab91d6e45e79d437
child 164961 9cf4757cb559b919b7b91a14fe6be9557b8cbcbf
push id4539
push userttaubert@mozilla.com
push dateThu, 23 Jan 2014 23:21:17 +0000
treeherderfx-team@f5ac964a5264 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs962729
milestone29.0a1
Bug 962729 - Sync toolbar button and menu item need to open the prefs dialog when logged in r=markh
browser/base/content/browser-syncui.js
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -278,17 +278,23 @@ let gSyncUI = {
    *          "reset" -- reset sync
    */
 
   openSetup: function SUI_openSetup(wizardType) {
     let xps = Components.classes["@mozilla.org/weave/service;1"]
                                 .getService(Components.interfaces.nsISupports)
                                 .wrappedJSObject;
     if (xps.fxAccountsEnabled) {
-      switchToTabHavingURI("about:accounts", true);
+      fxAccounts.getSignedInUser().then(userData => {
+        if (userData) {
+          this.openPrefs();
+        } else {
+          switchToTabHavingURI("about:accounts", true);
+        }
+      });
     } else {
       let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
       if (win)
         win.focus();
       else {
         window.openDialog("chrome://browser/content/sync/setup.xul",
                           "weaveSetup", "centerscreen,chrome,resizable=no",
                           wizardType);