From 01bdd529bc51b8dd780fcb500a4898115bc92b1d Mon Sep 17 00:00:00 2001 From: eight Date: Sun, 14 Oct 2018 00:39:17 +0800 Subject: [PATCH] Fix: updateCount --- background/style-via-api.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/background/style-via-api.js b/background/style-via-api.js index a9a79f78..e5fdf6ac 100644 --- a/background/style-via-api.js +++ b/background/style-via-api.js @@ -70,7 +70,8 @@ API_METHODS.styleViaAPI = !CHROME && (() => { cache.set(tab.id, tabFrames); } return Promise.all(tasks); - }); + }) + .then(() => updateCount(null, {tab, frameId})); } function styleDeleted({style: {id}}, {tab, frameId}) { @@ -79,7 +80,8 @@ API_METHODS.styleViaAPI = !CHROME && (() => { if (code && !duplicateCodeExists({frameStyles, id, code})) { delete frameStyles[id]; removeFrameIfEmpty(tab.id, frameId, tabFrames, frameStyles); - return removeCSS(tab.id, frameId, code); + return removeCSS(tab.id, frameId, code) + .then(() => updateCount(null, {tab, frameId})); } else { return NOP; }