@@ -15,14 +15,14 @@ final class AnalyticsHubViewModel: ObservableObject {
1515 init ( siteID: Int64 ,
1616 statsTimeRange: StatsTimeRangeV4 ,
1717 stores: StoresManager = ServiceLocator . stores) {
18- let selectedType = AnalyticsHubTimeRangeSelection . SelectionType. from ( statsTimeRange)
19- let timeRangeSelectionData = AnalyticsHubTimeRangeSelection ( selectionType: selectedType)
18+ let selectedType = AnalyticsHubTimeRangeSelection . SelectionType ( statsTimeRange)
19+ let timeRangeSelection = AnalyticsHubTimeRangeSelection ( selectionType: selectedType)
2020
2121 self . siteID = siteID
2222 self . stores = stores
2323 self . timeRangeSelectionType = selectedType
24- self . timeRangeSelection = timeRangeSelectionData
25- self . timeRangeCard = AnalyticsHubViewModel . timeRangeCard ( timeRangeSelectionData : timeRangeSelectionData )
24+ self . timeRangeSelection = timeRangeSelection
25+ self . timeRangeCard = AnalyticsHubViewModel . timeRangeCard ( timeRangeSelection : timeRangeSelection )
2626
2727 bindViewModelsWithData ( )
2828 }
@@ -146,7 +146,7 @@ private extension AnalyticsHubViewModel {
146146 . sink { [ weak self] newSelectionType in
147147 guard let self else { return }
148148 self . timeRangeSelection = AnalyticsHubTimeRangeSelection ( selectionType: newSelectionType)
149- self . timeRangeCard = AnalyticsHubViewModel . timeRangeCard ( timeRangeSelectionData : self . timeRangeSelection)
149+ self . timeRangeCard = AnalyticsHubViewModel . timeRangeCard ( timeRangeSelection : self . timeRangeSelection)
150150 Task . init {
151151 await self . updateData ( )
152152 }
@@ -201,10 +201,10 @@ private extension AnalyticsHubViewModel {
201201 isRedacted: false )
202202 }
203203
204- static func timeRangeCard( timeRangeSelectionData : AnalyticsHubTimeRangeSelection ) -> AnalyticsTimeRangeCardViewModel {
205- return AnalyticsTimeRangeCardViewModel ( selectedRangeTitle: timeRangeSelectionData . rangeSelectionDescription,
206- currentRangeSubtitle: timeRangeSelectionData . generateCurrentRangeDescription ( ) ,
207- previousRangeSubtitle: timeRangeSelectionData . generatePreviousRangeDescription ( ) )
204+ static func timeRangeCard( timeRangeSelection : AnalyticsHubTimeRangeSelection ) -> AnalyticsTimeRangeCardViewModel {
205+ return AnalyticsTimeRangeCardViewModel ( selectedRangeTitle: timeRangeSelection . rangeSelectionDescription,
206+ currentRangeSubtitle: timeRangeSelection . generateCurrentRangeDescription ( ) ,
207+ previousRangeSubtitle: timeRangeSelection . generatePreviousRangeDescription ( ) )
208208 }
209209}
210210
0 commit comments