Bug 804416 - Only use the social toolbar cache when the provider is active. r=felipe, a=gavin
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 23 Oct 2012 18:47:29 +1100
changeset 113714 3b3c91fdbbb91487fc5ba3f6db72d172705ab2f6
parent 113713 1faef77e84da7d85f5c6734a9301cf9cd3f83c8c
child 113715 0633ae7db53fd1b89c870b1213e39ff8e50e0bf8
push id2481
push userryanvm@gmail.com
push dateSat, 27 Oct 2012 23:58:38 +0000
treeherdermozilla-aurora@8447e7c219ca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe, gavin
bugs804416
milestone18.0a2
Bug 804416 - Only use the social toolbar cache when the provider is active. r=felipe, a=gavin
browser/base/content/browser-social.js
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -694,21 +694,22 @@ var SocialToolbar = {
     panel.hidden = false;
 
     let command = document.getElementById("Social:ToggleNotifications");
     command.setAttribute("checked", Services.prefs.getBoolPref("social.toast-notifications.enabled"));
 
     const CACHE_PREF_NAME = "social.cached.notificationIcons";
     // provider.profile == undefined means no response yet from the provider
     // to tell us whether the user is logged in or not.
-    if (!SocialUI.haveLoggedInUser() && provider.profile !== undefined) {
-      // The provider has responded with a profile and the user isn't logged
-      // in.  The icons etc have already been removed by
-      // updateButtonHiddenState, so we want to nuke any cached icons we
-      // have and get out of here!
+    if (!Social.provider || !Social.provider.enabled ||
+        (!SocialUI.haveLoggedInUser() && provider.profile !== undefined)) {
+      // Either no enabled provider, or there is a provider and it has
+      // responded with a profile and the user isn't loggedin.  The icons
+      // etc have already been removed by updateButtonHiddenState, so we want
+      // to nuke any cached icons we have and get out of here!
       Services.prefs.clearUserPref(CACHE_PREF_NAME);
       return;
     }
     if (Social.provider.profile === undefined) {
       // provider has not told us about the login state yet - see if we have
       // a cached version for this provider.
       let cached;
       try {