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

Fix for discrepancies in presenting results of Smart Blocking actions. Fix for GH-952. #39

Closed
wants to merge 14 commits into from
Fixing a typo
  • Loading branch information
Serge Zarembsky
Serge Zarembsky committed Apr 11, 2018
commit d52c68b43556c50f3b8bdf6f75ce19f47045689c
@@ -75,15 +75,23 @@ const offers = cliqz.modules['offers-v2'];
const CORRECT_STATE = 'CorrectState';

/**
* Handler for 'offers-re-registration' message coming from Offers module.
* Enable or disable specified module.
* @memberOf Background
* @param {Object} offersModule offers module
* @param {Object} event event broadcasted by Offers
* @param {Object} module Cliqz module
* @param {boolean} enabled true - enable, false - disable
* @return {Promise}
*/
function reRegisterWithOffers(offersModule, event) {
if (event && event.type === 'broadcast') {
registerWithOffers(offers, true);
function setCliqzModuleEnabled(module, enabled) {
if (enabled && !module.isEnabled) {
log('SET CLIQZ MODULE ENABLED', module);
return cliqz.enableModule(module.name);
} else if (!enabled && module.isEnabled) {
log('SET CLIQZ MODULE DISABLED', module);
cliqz.disableModule(module.name);
return Promise.resolve();
}
log('MODULE IS ALREADY IN CORRECT STATE', module, enabled);
return Promise.resolve(CORRECT_STATE);
}
/**
* Check and fetch (if needed) a new tracker library every 12 hours
ProTip! Use n and p to navigate between commits in a pull request.