Skip to content

Commit

Permalink
Update InsightsManagementMapper.kt
Browse files Browse the repository at this point in the history
Remove IS_JETPACK_APP check since Stats only on Jetpack app now
  • Loading branch information
ravishanker committed Feb 22, 2024
1 parent 88734d0 commit a51652d
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.wordpress.android.ui.stats.refresh.lists.sections.insights.managemen

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
import org.wordpress.android.BuildConfig
import org.wordpress.android.R
import org.wordpress.android.fluxc.store.StatsStore.InsightType
import org.wordpress.android.fluxc.store.StatsStore.InsightType.ACTION_GROW
Expand Down Expand Up @@ -59,13 +58,10 @@ class InsightsManagementMapper @Inject constructor(
withContext(bgDispatcher) {
val insightListItems = mutableListOf<InsightListItem>()
insightListItems += Header(R.string.stats_insights_management_general)
if (BuildConfig.IS_JETPACK_APP &&
!trafficTabFeatureConfig.isEnabled() &&
!GENERAL_INSIGHTS.contains(TODAY_STATS)
) {
if (!trafficTabFeatureConfig.isEnabled() && !GENERAL_INSIGHTS.contains(TODAY_STATS)) {
GENERAL_INSIGHTS.add(TODAY_STATS)
}
if (BuildConfig.IS_JETPACK_APP && !GENERAL_INSIGHTS.contains(VIEWS_AND_VISITORS)) {
if (!GENERAL_INSIGHTS.contains(VIEWS_AND_VISITORS)) {
GENERAL_INSIGHTS.add(0, VIEWS_AND_VISITORS)
}
insightListItems += GENERAL_INSIGHTS.map { type ->
Expand All @@ -77,7 +73,7 @@ class InsightsManagementMapper @Inject constructor(
}
insightListItems += Header(R.string.stats_insights_management_activity)

if (BuildConfig.IS_JETPACK_APP && ACTIVITY_INSIGHTS.contains(FOLLOWER_TOTALS)) {
if (ACTIVITY_INSIGHTS.contains(FOLLOWER_TOTALS)) {
// Replace FOLLOWER_TOTALS with Stats revamp v2 total insights
val followerTotalsIndex = ACTIVITY_INSIGHTS.indexOf(FOLLOWER_TOTALS)
ACTIVITY_INSIGHTS.remove(FOLLOWER_TOTALS)
Expand Down

0 comments on commit a51652d

Please sign in to comment.