diff options
Diffstat (limited to '')
-rw-r--r-- | browser/components/pocket/content/pktUI.js | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/browser/components/pocket/content/pktUI.js b/browser/components/pocket/content/pktUI.js index 60b7e3bcc3..05e31b5c30 100644 --- a/browser/components/pocket/content/pktUI.js +++ b/browser/components/pocket/content/pktUI.js @@ -46,7 +46,6 @@ ChromeUtils.defineESModuleGetters(this, { ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs", - NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", pktApi: "chrome://pocket/content/pktApi.sys.mjs", pktTelemetry: "chrome://pocket/content/pktTelemetry.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", @@ -125,11 +124,13 @@ var pktUI = (function () { * Show the sign-up panel */ function showSignUp() { - getFirefoxAccountSignedInUser(function (userdata) { + getFirefoxAccountSignedInUser(function () { showPanel( "about:pocket-signup?" + "emailButton=" + - NimbusFeatures.saveToPocket.getVariable("emailButton"), + Services.prefs.getBoolPref( + "extensions.pocket.refresh.emailButton.enabled" + ), `signup` ); }); @@ -154,8 +155,9 @@ var pktUI = (function () { * Show the Pocket home panel state */ function showPocketHome() { - const hideRecentSaves = - NimbusFeatures.saveToPocket.getVariable("hideRecentSaves"); + const hideRecentSaves = Services.prefs.getBoolPref( + "extensions.pocket.refresh.hideRecentSaves.enabled" + ); const locale = getUILocale(); let panel = `home_no_topics`; if (locale.startsWith("en-")) { @@ -232,7 +234,11 @@ var pktUI = (function () { async function onShowHome() { pktTelemetry.submitPocketButtonPing("click", "home_button"); - if (!NimbusFeatures.saveToPocket.getVariable("hideRecentSaves")) { + if ( + !Services.prefs.getBoolPref( + "extensions.pocket.refresh.hideRecentSaves.enabled" + ) + ) { let recentSaves = await pktApi.getRecentSavesCache(); if (recentSaves) { // We have cache, so we can use those. @@ -284,7 +290,7 @@ var pktUI = (function () { // Add url var options = { - success(data, request) { + success(data) { var item = data.item; var ho2 = data.ho2; var accountState = data.account_state; @@ -299,7 +305,11 @@ var pktUI = (function () { pktUIMessaging.sendMessageToPanel(saveLinkMessageId, successResponse); SaveToPocket.itemSaved(); - if (!NimbusFeatures.saveToPocket.getVariable("hideRecentSaves")) { + if ( + !Services.prefs.getBoolPref( + "extensions.pocket.refresh.hideRecentSaves.enabled" + ) + ) { // Articles saved for the first time (by anyone) won't have a resolved_id if (item?.resolved_id && item?.resolved_id !== "0") { pktApi.getArticleInfo(item.resolved_url, { @@ -493,7 +503,7 @@ var pktUI = (function () { .then(userData => { callback(userData); }) - .then(null, error => { + .then(null, () => { callback(); }); } |