summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaming4JC <g4jc@bulletmail.org>2018-12-16 17:19:33 -0500
committerGaming4JC <g4jc@bulletmail.org>2018-12-16 17:19:33 -0500
commit9ea7809abe7866ada574e9a58181304cb4155bb7 (patch)
tree2ee0343c8097150935602452faf3e43bf3008dac
parent9a1386e1cce88efa9da1726addea8acfa9880bbe (diff)
downloadiceweasel-uxp-9ea7809abe7866ada574e9a58181304cb4155bb7.tar.gz
backport uxp: Enable the legacy panels for the sync preferences.
-rw-r--r--components/preferences/in-content/sync.js109
1 files changed, 2 insertions, 107 deletions
diff --git a/components/preferences/in-content/sync.js b/components/preferences/in-content/sync.js
index eba8d0f..c784f15 100644
--- a/components/preferences/in-content/sync.js
+++ b/components/preferences/in-content/sync.js
@@ -299,113 +299,8 @@ var gSyncPane = {
let service = Components.classes["@mozilla.org/weave/service;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
- // service.fxAccountsEnabled is false iff sync is already configured for
- // the legacy provider.
- if (service.fxAccountsEnabled) {
- let displayNameLabel = document.getElementById("fxaDisplayName");
- let fxaEmailAddress1Label = document.getElementById("fxaEmailAddress1");
- fxaEmailAddress1Label.hidden = false;
- displayNameLabel.hidden = true;
-
- let profileInfoEnabled;
- try {
- profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
- } catch (ex) {}
-
- // determine the fxa status...
- this._showLoadPage(service);
-
- fxAccounts.getSignedInUser().then(data => {
- if (!data) {
- this.page = FXA_PAGE_LOGGED_OUT;
- return false;
- }
- this.page = FXA_PAGE_LOGGED_IN;
- // We are logged in locally, but maybe we are in a state where the
- // server rejected our credentials (eg, password changed on the server)
- let fxaLoginStatus = document.getElementById("fxaLoginStatus");
- let syncReady;
- // Not Verfied implies login error state, so check that first.
- if (!data.verified) {
- fxaLoginStatus.selectedIndex = FXA_LOGIN_UNVERIFIED;
- syncReady = false;
- // So we think we are logged in, so login problems are next.
- // (Although if the Sync identity manager is still initializing, we
- // ignore login errors and assume all will eventually be good.)
- // LOGIN_FAILED_LOGIN_REJECTED explicitly means "you must log back in".
- // All other login failures are assumed to be transient and should go
- // away by themselves, so aren't reflected here.
- } else if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) {
- fxaLoginStatus.selectedIndex = FXA_LOGIN_FAILED;
- syncReady = false;
- // Else we must be golden (or in an error state we expect to magically
- // resolve itself)
- } else {
- fxaLoginStatus.selectedIndex = FXA_LOGIN_VERIFIED;
- syncReady = true;
- }
- fxaEmailAddress1Label.textContent = data.email;
- document.getElementById("fxaEmailAddress2").textContent = data.email;
- document.getElementById("fxaEmailAddress3").textContent = data.email;
- this._populateComputerName(Weave.Service.clientsEngine.localName);
- let engines = document.getElementById("fxaSyncEngines")
- for (let checkbox of engines.querySelectorAll("checkbox")) {
- checkbox.disabled = !syncReady;
- }
- document.getElementById("fxaChangeDeviceName").disabled = !syncReady;
-
- // Clear the profile image (if any) of the previously logged in account.
- document.getElementById("fxaProfileImage").style.removeProperty("list-style-image");
-
- // If the account is verified the next promise in the chain will
- // fetch profile data.
- return data.verified;
- }).then(isVerified => {
- if (isVerified) {
- return fxAccounts.getSignedInUserProfile();
- }
- return null;
- }).then(data => {
- let fxaLoginStatus = document.getElementById("fxaLoginStatus");
- if (data && profileInfoEnabled) {
- if (data.displayName) {
- fxaLoginStatus.setAttribute("hasName", true);
- displayNameLabel.hidden = false;
- displayNameLabel.textContent = data.displayName;
- } else {
- fxaLoginStatus.removeAttribute("hasName");
- }
- if (data.avatar) {
- let bgImage = "url(\"" + data.avatar + "\")";
- let profileImageElement = document.getElementById("fxaProfileImage");
- profileImageElement.style.listStyleImage = bgImage;
-
- let img = new Image();
- img.onerror = () => {
- // Clear the image if it has trouble loading. Since this callback is asynchronous
- // we check to make sure the image is still the same before we clear it.
- if (profileImageElement.style.listStyleImage === bgImage) {
- profileImageElement.style.removeProperty("list-style-image");
- }
- };
- img.src = data.avatar;
- }
- } else {
- fxaLoginStatus.removeAttribute("hasName");
- }
- }, err => {
- FxAccountsCommon.log.error(err);
- }).catch(err => {
- // If we get here something's really busted
- Cu.reportError(String(err));
- });
-
- // If fxAccountEnabled is false and we are in a "not configured" state,
- // then fxAccounts is probably fully disabled rather than just unconfigured,
- // so handle this case. This block can be removed once we remove support
- // for fxAccounts being disabled.
- } else if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED ||
- Weave.Svc.Prefs.get("firstSync", "") == "notReady") {
+ if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED ||
+ Weave.Svc.Prefs.get("firstSync", "") == "notReady") {
this.page = PAGE_NO_ACCOUNT;
// else: sync was previously configured for the legacy provider, so we
// make the "old" panels available.