Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for enabling offers on upgrade and for Setup data sharing checkboxes. #117

Merged
merged 3 commits into from Jun 27, 2018
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Prev

Extra fix for enabling offers on upgrade.

  • Loading branch information
zarembsky committed Jun 27, 2018
commit 1db187fe203964f02680f6887a0871c1a668d879
@@ -450,9 +450,6 @@ function handleRewards(name, message, tab_id, callback) {
rewards.deleteReward(message.offerId);
button.update();
break;
case 'rewardsDisabled':
conf.enable_offers = false;
break;
case 'rewardsPromptAccepted':
conf.rewards_accepted = true;
break;
@@ -1436,13 +1433,14 @@ function initializeGhosteryModules() {
if (globals.JUST_UPGRADED_FROM_7) {
conf.enable_ad_block = false;
conf.enable_anti_tracking = false;
conf.enable_offers = false;
conf.enable_offers = !((IS_EDGE || IS_CLIQZ));
conf.enable_human_web = (IS_EDGE || IS_CLIQZ) ? false : conf.enable_human_web;
} else {
conf.enable_ad_block = IS_CLIQZ ? false : !adblocker.isDisabled;
conf.enable_anti_tracking = IS_CLIQZ ? false : !antitracking.isDisabled;
conf.enable_human_web = (IS_EDGE || IS_CLIQZ) ? false : !humanweb.isDisabled;
conf.enable_offers = (IS_EDGE || IS_CLIQZ) ? false : !offers.isDisabled;
// This code forces enable_offers to true on upgrade. Remove in the next version of Ghostery!
conf.enable_offers = (IS_EDGE || IS_CLIQZ) ? false : globals.JUST_UPGRADED ? true : !offers.isDisabled;
}
})).catch((e) => {
log('cliqzStartup error', e);
@@ -92,8 +92,8 @@ class ConfData {
_initProperty('trackers_banner_status', true);
}

//Disregard original offers value, so that default value is assigned.
//REMOVE THIS IS THE NEXT VERSION
// Disregard original offers value, so that default value is assigned.
// REMOVE THIS IS THE NEXT VERSION
delete data.enable_offers;

// simple props
@@ -125,9 +125,6 @@ class Rewards {
case 'rewardSignal':
this.sendSignal(message.message);
break;
case 'rewardsDisabled':
conf.enable_offers = false;
break;
case 'rewardsPromptAccepted':
// @TODO set conf disabled
conf.rewards_accepted = true;
ProTip! Use n and p to navigate between commits in a pull request.