Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #4995: Don't show Brave News inline ads when there are no feed items #4997

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Client/Frontend/Brave Today/Composer/FeedDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,15 @@ class FeedDataSource {
generatedCards.append(contentsOf: elementCards)
}
}
if generatedCards.count < 10, generatedCards.allSatisfy({
if case .ad = $0 {
return true
}
return false
}) {
// If there are less than 10 cards and they all are ads, show nothing
generatedCards.removeAll()
}
DispatchQueue.main.async {
completion(generatedCards)
}
Expand Down