From 72cd81d1262037fc5bbe392077ad43396571b0cb Mon Sep 17 00:00:00 2001 From: wanhose Date: Tue, 27 Feb 2024 20:12:09 +0100 Subject: [PATCH] feat(browser-extension): increase count if hide backdrop --- packages/browser-extension/src/scripts/content.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/browser-extension/src/scripts/content.js b/packages/browser-extension/src/scripts/content.js index 4ba6771..b437061 100644 --- a/packages/browser-extension/src/scripts/content.js +++ b/packages/browser-extension/src/scripts/content.js @@ -209,8 +209,10 @@ function fix() { const fixes = data?.fixes ?? []; const skips = (data?.skips ?? []).map((x) => (x.split('.').length < 3 ? `*${x}` : x)); - if (backdrop?.children.length === 0) { + if (backdrop?.children.length === 0 && backdrop.style.display !== 'none') { backdrop.style.setProperty('display', 'none'); + count += 1; + dispatch({ type: 'SET_BADGE', value: `${count}` }); } for (const fix of fixes) {