Skip to content

Commit

Permalink
Show reader announcement card only on Discover feed
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanLukas committed May 22, 2024
1 parent 6f3a6bb commit 00dd7ea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ class ReaderViewModel @Inject constructor(
descriptionRes = R.string.reader_announcement_card_reading_preferences_description,
)
)

val isDiscoverSelected = selectedReaderTag()?.isDiscover == true
_announcementCardState.value = AnnouncementCardUiState(
shouldShow = readerAnnouncementCardFeatureConfig.isEnabled() &&
shouldShow = isDiscoverSelected && readerAnnouncementCardFeatureConfig.isEnabled() &&
appPrefsWrapper.shouldShowReaderAnnouncementCard(),
items = items,
)
Expand Down Expand Up @@ -213,6 +213,7 @@ class ReaderViewModel @Inject constructor(
}

fun onTagChanged(selectedTag: ReaderTag?) {
updateAnnouncementCard()
selectedTag?.let {
trackReaderTabShownIfNecessary(it)
}
Expand Down

0 comments on commit 00dd7ea

Please sign in to comment.