From 2f79076faa8cd3d3fccd996d84954990296fa8ff Mon Sep 17 00:00:00 2001 From: eight04 Date: Fri, 10 Dec 2021 20:10:42 +0800 Subject: [PATCH] Fix: remove unused if --- background/style-via-api.js | 4 +--- content/apply.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/background/style-via-api.js b/background/style-via-api.js index c77d6e24..64e95e8f 100644 --- a/background/style-via-api.js +++ b/background/style-via-api.js @@ -56,9 +56,7 @@ return NOP; } return API.styles.getSectionsByUrl(url, id).then(sections => { - if (sections.cfg) { - delete sections.cfg; - } + delete sections.cfg; const tasks = []; for (const section of Object.values(sections)) { const styleId = section.id; diff --git a/content/apply.js b/content/apply.js index 48df0a2d..1176ea50 100644 --- a/content/apply.js +++ b/content/apply.js @@ -187,9 +187,7 @@ if (!hasStyles && isDisabled || matchUrl === request.url) break; matchUrl = request.url; API.styles.getSectionsByUrl(matchUrl).then(sections => { - if (sections.cfg) { - delete sections.cfg; - } + delete sections.cfg; hasStyles = true; styleInjector.replace(sections); });