Skip to content

Commit

Permalink
make sure the exlusion of different domains works
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Jun 8, 2024
1 parent b702384 commit 5479ec6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/content-scripts/content_script/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
6 changes: 4 additions & 2 deletions src/util/nudges-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5479ec6

Please sign in to comment.