Skip to content

Commit

Permalink
Organize imports in SelectedSectionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
irfano committed Mar 25, 2024
1 parent 468adff commit 7cbb4fb
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import org.wordpress.android.fluxc.network.utils.StatsGranularity.MONTHS
import org.wordpress.android.fluxc.network.utils.StatsGranularity.WEEKS
import org.wordpress.android.fluxc.network.utils.StatsGranularity.YEARS
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.INSIGHTS
import org.wordpress.android.ui.stats.refresh.lists.StatsListViewModel.StatsSection.TRAFFIC
import org.wordpress.android.util.config.StatsTrafficTabFeatureConfig
import javax.inject.Inject

Expand All @@ -33,9 +31,9 @@ class SelectedSectionManager
}

fun getSelectedSection(): StatsSection {
val defaultValue = if (statsTrafficTabFeatureConfig.isEnabled()) TRAFFIC else INSIGHTS
val defaultValue = if (statsTrafficTabFeatureConfig.isEnabled()) StatsSection.TRAFFIC else StatsSection.INSIGHTS
val value = sharedPrefs.getString(SELECTED_SECTION_KEY, defaultValue.name)
return value?.let { StatsSection.valueOf(value) } ?: INSIGHTS
return value?.let { StatsSection.valueOf(value) } ?: StatsSection.INSIGHTS
}

fun setSelectedSection(selectedSection: StatsSection) {
Expand Down

0 comments on commit 7cbb4fb

Please sign in to comment.