Skip to content

Commit

Permalink
Revert "Update StatsViewModel.kt"
Browse files Browse the repository at this point in the history
This reverts commit 7c02ba5.
  • Loading branch information
ravishanker committed Feb 28, 2024
1 parent 7c02ba5 commit 5fe88d0
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,7 @@ class StatsViewModel
}

private fun getInitialTimeFrame(intent: Intent): StatsSection? {
val timeframe = intent.getSerializableExtraCompat<StatsTimeframe>(StatsActivity.ARG_DESIRED_TIMEFRAME)
if (statsTrafficTabFeatureConfig.isEnabled()) {
if (timeframe == DAY || timeframe == WEEK || timeframe == MONTH || timeframe == YEAR) {
when (timeframe) {
DAY -> selectedTrafficGranularityManager.setSelectedTrafficGranularity(StatsGranularity.DAYS)
WEEK -> selectedTrafficGranularityManager.setSelectedTrafficGranularity(StatsGranularity.WEEKS)
MONTH -> selectedTrafficGranularityManager.setSelectedTrafficGranularity(StatsGranularity.MONTHS)
YEAR -> selectedTrafficGranularityManager.setSelectedTrafficGranularity(StatsGranularity.YEARS)
else -> { /* Do nothing */}
}
}
}

return when (timeframe) {
return when (intent.getSerializableExtraCompat<Serializable>(StatsActivity.ARG_DESIRED_TIMEFRAME)) {
StatsTimeframe.INSIGHTS -> StatsSection.INSIGHTS
DAY -> StatsSection.DAYS
WEEK -> StatsSection.WEEKS
Expand Down

0 comments on commit 5fe88d0

Please sign in to comment.