Skip to content

Commit

Permalink
Move switch check to top level so that switch is always respected
Browse files Browse the repository at this point in the history
  • Loading branch information
emma-imber committed May 21, 2024
1 parent 3e9c079 commit 7d0888a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/app/views/support/HtmlCleaner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -941,11 +941,11 @@ object AffiliateLinksCleaner {
): Boolean = {

// Never include affiliate links if it is tagged with an always off tag
if (!contentHasAlwaysOffTag(tagPaths, alwaysOffTags)) {
if (!contentHasAlwaysOffTag(tagPaths, alwaysOffTags) && switchedOn) {
if (showAffiliateLinks.isDefined) {
showAffiliateLinks.contains(true)
} else {
switchedOn && supportedSections.contains(section) && !tagPaths.exists(path => defaultOffTags.contains(path))
supportedSections.contains(section) && !tagPaths.exists(path => defaultOffTags.contains(path))
}
} else false
}
Expand Down

0 comments on commit 7d0888a

Please sign in to comment.