diff --git a/src/content-scripts/content_script/global.ts b/src/content-scripts/content_script/global.ts index 5fffe4de56..c2fdd7675b 100644 --- a/src/content-scripts/content_script/global.ts +++ b/src/content-scripts/content_script/global.ts @@ -1669,7 +1669,10 @@ export async function main( 'https://web.telegram.org/', ] - if (!excludedPages.includes(window.location.href) && !pageHasBookark) { + if ( + !excludedPages.some((url) => window.location.href.includes(url)) && + !pageHasBookark + ) { document.addEventListener('scroll', debouncedCheckScrollPosition) } diff --git a/src/util/nudges-utils.tsx b/src/util/nudges-utils.tsx index e2d5620707..b086f36c4e 100644 --- a/src/util/nudges-utils.tsx +++ b/src/util/nudges-utils.tsx @@ -26,15 +26,17 @@ export async function updateNudgesCounter( return false } else { nudgeKeyCount = nudgeKeyCount + 1 - onboardingNudgesValues[nudgeType] = nudgeKeyCount if (nudgeKeyCount === ONBOARDING_NUDGES_MAX_COUNT[nudgeType]) { + onboardingNudgesValues[nudgeType] = nudgeKeyCount await browserAPIs.storage.local.set({ [ONBOARDING_NUDGES_STORAGE]: onboardingNudgesValues, }) return true } else { if (nudgeKeyCount > ONBOARDING_NUDGES_MAX_COUNT[nudgeType]) { - nudgeKeyCount = 0 + onboardingNudgesValues[nudgeType] = 0 + } else { + onboardingNudgesValues[nudgeType] = nudgeKeyCount } await browserAPIs.storage.local.set({ [ONBOARDING_NUDGES_STORAGE]: onboardingNudgesValues,