Skip to content

Commit ac3424c

Browse files
committed
Update tracker animation tile dismissal logic and conditionally include based on tab count
Only show if we have 2 or more tabs open Next we'll extract this logic out
1 parent b341691 commit ac3424c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/com/duckduckgo/app/tabs/ui/TabSwitcherViewModel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ class TabSwitcherViewModel @Inject constructor(
227227
}
228228
}
229229

230-
fun onTrackerAnimationTileCloseClicked() {
230+
fun onTrackerAnimationTileCloseClicked(isDismissed: Boolean = true) {
231231
viewModelScope.launch(dispatcherProvider.io()) {
232-
tabSwitcherPrefsDataStore.setIsAnimationTileDismissed(isDismissed = true)
232+
tabSwitcherPrefsDataStore.setIsAnimationTileDismissed(isDismissed = isDismissed)
233233
}
234234
}
235235

@@ -250,7 +250,7 @@ class TabSwitcherViewModel @Inject constructor(
250250
val tabItems = tabEntities.map { Tab(it) }
251251
val trackerCount = getTrackerCountForLast7Days()
252252

253-
val tabSwitcherItems = if (!isDismissed && trackerCount >= 10) {
253+
val tabSwitcherItems = if (!isDismissed && trackerCount >= 10 && tabEntities.count() >= 2) {
254254
listOf(TrackerAnimationTile(trackerCount)) + tabItems
255255
} else {
256256
tabItems

0 commit comments

Comments
 (0)