Skip to content

Commit 456f91a

Browse files
committed
refactor(feed_decorator_service): simplify ad placement check
- Replace multiple type checks with a single inverse check for AdPlaceholder - Improve code readability and maintainability - Ensure ad placement is based on content/decorator density as intended
1 parent 0accdb6 commit 456f91a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/shared/services/feed_decorator_service.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,7 @@ class FeedDecoratorService {
477477
// Only increment the content item counter if the current item is
478478
// a primary content type or a decorator (not an ad placeholder).
479479
// This ensures ad placement is based purely on content/decorator density.
480-
if (item is Headline ||
481-
item is Topic ||
482-
item is Source ||
483-
item is Country ||
484-
item is CallToActionItem ||
485-
item is ContentCollectionItem
486-
) {
480+
if (item is! AdPlaceholder) {
487481
currentContentItemCount++;
488482
}
489483

0 commit comments

Comments
 (0)