File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
app/src/main/java/com/duckduckgo/app/tabs/ui Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -248,13 +248,21 @@ class TabSwitcherViewModel @Inject constructor(
248
248
) {
249
249
tabSwitcherPrefsDataStore.isAnimationTileDismissed().collect { isDismissed ->
250
250
val tabItems = tabEntities.map { Tab (it) }
251
+ val trackerCount = getTrackerCountForLast7Days()
251
252
252
- val tabSwitcherItems = if (! isDismissed) {
253
- listOf (createTrackerAnimationTile( )) + tabItems
253
+ val tabSwitcherItems = if (! isDismissed && trackerCount >= 10 ) {
254
+ listOf (TrackerAnimationTile (trackerCount )) + tabItems
254
255
} else {
255
256
tabItems
256
257
}
257
258
emit(tabSwitcherItems)
258
259
}
259
260
}
261
+
262
+ private suspend fun getTrackerCountForLast7Days (): Int {
263
+ return webTrackersBlockedAppRepository.getTrackersCountBetween(
264
+ startTime = LocalDateTime .now().minusDays(7 ),
265
+ endTime = LocalDateTime .now(),
266
+ )
267
+ }
260
268
}
You can’t perform that action at this time.
0 commit comments