@@ -126,9 +126,13 @@ class SiteStatsInsightsViewModel: Observable {
126126 type: . insights,
127127 status: insightsStore. followersTotalsStatus,
128128 block: {
129+ if FeatureFlag . statsNewInsights. enabled {
130+ return TotalInsightStatsRow ( dataRow: createFollowerTotalInsightsRow ( ) , statSection: . insightsFollowerTotals, siteStatsInsightsDelegate: siteStatsInsightsDelegate)
131+ } else {
129132 return TwoColumnStatsRow ( dataRows: createTotalFollowersRows ( ) ,
130133 statSection: . insightsFollowerTotals,
131134 siteStatsInsightsDelegate: nil )
135+ }
132136 } , loading: {
133137 return StatsGhostTwoColumnImmutableRow ( )
134138 } , error: errorBlock) )
@@ -413,12 +417,12 @@ private extension SiteStatsInsightsViewModel {
413417 let totalEmailFollowers = insightsStore. getEmailFollowers ( ) ? . emailFollowersCount ?? 0
414418
415419 var totalPublicize = 0
416- if let publicize = insightsStore. getPublicize ( ) , !publicize. publicizeServices. isEmpty {
420+ if let publicize = insightsStore. getPublicize ( ) ,
421+ !publicize. publicizeServices. isEmpty {
417422 totalPublicize = publicize. publicizeServices. compactMap ( { $0. followers} ) . reduce ( 0 , + )
418423 }
419424
420- let totalFollowers = totalDotComFollowers + totalEmailFollowers + totalPublicize
421-
425+ let totalFollowers = insightsStore. getTotalFollowerCount ( )
422426 guard totalFollowers > 0 else {
423427 return [ ]
424428 }
@@ -438,6 +442,10 @@ private extension SiteStatsInsightsViewModel {
438442 return dataRows
439443 }
440444
445+ func createFollowerTotalInsightsRow( ) -> StatsTotalInsightsData {
446+ return StatsTotalInsightsData ( count: insightsStore. getTotalFollowerCount ( ) . abbreviatedString ( ) )
447+ }
448+
441449 func createPublicizeRows( ) -> [ StatsTotalRowData ] {
442450 guard let services = insightsStore. getPublicize ( ) ? . publicizeServices else {
443451 return [ ]
0 commit comments