Skip to content

Commit

Permalink
Fetch limited count date of dates instead of 15 dates on TRAFFIC tab
Browse files Browse the repository at this point in the history
  • Loading branch information
irfano committed Mar 14, 2024
1 parent b3c7fcf commit 73b17ea
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class TrafficOverviewUseCase(
else -> statsGranularity
}

private val barCount = when (lowerGranularity) {
private val itemsToLoad = when (lowerGranularity) {
StatsGranularity.DAYS -> 7
StatsGranularity.WEEKS -> 5
StatsGranularity.WEEKS -> 6
StatsGranularity.MONTHS -> 12
else -> OVERVIEW_ITEMS_TO_LOAD
}
Expand Down Expand Up @@ -122,7 +122,7 @@ class TrafficOverviewUseCase(
// Fetch lower granularity model for chart values
val lowerGranularityResponse = if (statsGranularity != StatsGranularity.DAYS) {
val selectedDate = getLastDate(model)
selectedDate?.let { fetchVisit(lowerGranularity, OVERVIEW_ITEMS_TO_LOAD, forced, it) }
selectedDate?.let { fetchVisit(lowerGranularity, itemsToLoad, forced, it) }
} else {
null
}
Expand Down

0 comments on commit 73b17ea

Please sign in to comment.