Bug 1564877 - Fix fxa avatar not clearing on sign out r=eoger
authorVijay Budhram <vbudhram@mozilla.com>
Wed, 10 Jul 2019 20:06:33 +0000
changeset 482270 1edf0457ac230fdbdb31fd621bb49c4188daa9fc
parent 482269 dc058b3425f758eadb09e6c18d872d8635b4a23d
child 482271 27679131d486cb10ecb6337688db6e84cc8b48e4
push id89665
push userrvandermeulen@mozilla.com
push dateWed, 10 Jul 2019 20:08:21 +0000
treeherderautoland@1edf0457ac23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseoger
bugs1564877
milestone70.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 1564877 - Fix fxa avatar not clearing on sign out r=eoger Differential Revision: https://phabricator.services.mozilla.com/D37571
browser/base/content/browser-sync.js
--- a/browser/base/content/browser-sync.js
+++ b/browser/base/content/browser-sync.js
@@ -354,22 +354,24 @@ var gSync = {
       PanelUI.showSubView(viewId, anchor, aEvent);
     }
   },
 
   updateFxAPanel(state = {}) {
     const mainWindowEl = document.documentElement;
 
     // The Firefox Account toolbar currently handles 3 different states for
-    // users. The default `not_configured state shows an empty avatar, `unverified`
+    // users. The default `not_configured` state shows an empty avatar, `unverified`
     // state shows an avatar with an email icon and the `verified` state will show
     // the users custom profile image or a filled avatar.
     let stateValue = "not_configured";
     document.getElementById("PanelUI-fxa").removeAttribute("title");
-    if (
+    if (state.status === UIState.STATUS_NOT_CONFIGURED) {
+      mainWindowEl.style.removeProperty("--avatar-image-url");
+    } else if (
       state.status === UIState.STATUS_LOGIN_FAILED ||
       state.status === UIState.STATUS_NOT_VERIFIED
     ) {
       stateValue = "unverified";
     } else if (state.status === UIState.STATUS_SIGNED_IN) {
       stateValue = "signedin";
       if (state.avatarURL && !state.avatarIsDefault) {
         // The user has specified a custom avatar, attempt to load the image on all the menu buttons.