From 4c616442f649f56ea51e4bf9df8174f4b886118d Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 31 Aug 2017 13:41:48 +0300 Subject: [PATCH] correctly show/hide #no-styles message in the popup --- popup/popup.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/popup/popup.js b/popup/popup.js index 40b4a2f6..093d2478 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -318,6 +318,8 @@ Object.assign(handleEvent, { }); if (ok) { deleteStyleSafe({id}).then(() => { + // don't wait for the async notifyAllTabs as we check the children right away + handleDelete(id); // update view with 'No styles installed for this site' message if (!installed.children.length) { showStyles([]); @@ -402,7 +404,7 @@ function handleUpdate(style) { // Add an entry when a new style for the current url is installed if (tabURL && BG.getApplicableSections({style, matchUrl: tabURL, stopOnFirst: true}).length) { document.body.classList.remove('blocked'); - $$('.blocked-info').forEach(el => el.remove()); + $$('.blocked-info, #no-styles').forEach(el => el.remove()); createStyleElement({style}); } }