Bug 1153708 - put the FxA profile fetch behind the same pref used to display the avatar. r=zaach
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 06 May 2015 11:38:06 +1000
changeset 273815 541073e6d2272d777df949850f059a29da9273f1
parent 273814 d544be8b3dc3a983dbd50a5942080eb870d15477
child 273816 4715ff680f36be87fabd756da59cd094ec542f73
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszaach
bugs1153708
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1153708 - put the FxA profile fetch behind the same pref used to display the avatar. r=zaach
browser/components/preferences/in-content/sync.js
--- a/browser/components/preferences/in-content/sync.js
+++ b/browser/components/preferences/in-content/sync.js
@@ -296,19 +296,25 @@ let gSyncPane = {
         }
 
         // Clear the profile image (if any) of the previously logged in account.
         document.getElementById("fxaProfileImage").style.removeProperty("background-image");
 
         // If the account is verified the next promise in the chain will
         // fetch profile data.
         return data.verified;
-      }).then(shouldGetProfile => {
-        if (shouldGetProfile) {
-          return fxAccounts.getSignedInUserProfile();
+      }).then(isVerified => {
+        if (isVerified) {
+          let enabled;
+          try {
+            enabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
+          } catch (ex) {}
+          if (enabled) {
+            return fxAccounts.getSignedInUserProfile();
+          }
         }
       }).then(data => {
         if (data && data.avatar) {
           // Make sure the image is available before displaying it,
           // as we don't want to overwrite the default profile image
           // with a broken/unavailable image
           let img = new Image();
           img.onload = () => {