Skip to content

Commit

Permalink
Fix opera bug where button and counter out of sync
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmThePan authored and christophertino committed Jul 13, 2018
1 parent 751efc7 commit 7ac1c27
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,20 +682,16 @@ function onMessageHandler(request, sender, callback) {
const modules = { adblock: {}, antitracking: {} };
utils.getActiveTab((tab) => {
button.update();
if (conf.enable_ad_block) {
modules.adblock = cliqz.modules.adblocker.background.actions.getAdBlockInfoForTab(tab.id);
}
if (conf.enable_anti_tracking) {
cliqz.modules.antitracking.background.actions.aggregatedBlockingStats(tab.id).then((data) => {
modules.antitracking = data;
// send adblock and antitracking together
if (conf.enable_ad_block) {
modules.adblock = cliqz.modules.adblocker.background.actions.getAdBlockInfoForTab(tab.id);
}
callback(modules);
}).catch((err) => {
callback(modules);
});
} else if (conf.enable_ad_block) {
modules.adblock = cliqz.modules.adblocker.background.actions.getAdBlockInfoForTab(tab.id);
callback(modules);
} else {
callback(modules);
}
Expand Down

0 comments on commit 7ac1c27

Please sign in to comment.