File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ final class StoreInfoDataService {
1717 ///
1818 private var orderStatsRemoteV4 : OrderStatsRemoteV4
1919
20- /// Visitors remoute source
20+ /// Visitors remote source
2121 ///
2222 private var siteVisitStatsRemote : SiteVisitStatsRemote
2323
@@ -31,9 +31,9 @@ final class StoreInfoDataService {
3131 siteVisitStatsRemote = SiteVisitStatsRemote ( network: network)
3232 }
3333
34- /// Async function that fetches todays stats data.
34+ /// Async function that fetches stats data for given time range .
3535 ///
36- func fetchTodayStats ( for storeID: Int64 ) async throws -> Stats {
36+ func fetchStats ( for storeID: Int64 , timeRange : StatsTimeRange ) async throws -> Stats {
3737 // Prepare them to run in parallel
3838 async let revenueAndOrdersRequest = fetchTodaysRevenueAndOrders ( for: storeID)
3939 async let visitorsRequest = fetchTodaysVisitors ( for: storeID)
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ final class StoreInfoProvider: IntentTimelineProvider {
9090 networkService = strongService
9191 Task {
9292 do {
93- let todayStats = try await strongService. fetchTodayStats ( for: dependencies. storeID)
93+ let todayStats = try await strongService. fetchStats ( for: dependencies. storeID, timeRange : StatsTimeRange ( configuration . timeRange ) )
9494 let entry = Self . dataEntry ( for: todayStats, with: dependencies)
9595 let reloadDate = Date ( timeIntervalSinceNow: reloadInterval)
9696 let timeline = Timeline < StoreInfoEntry > ( entries: [ entry] , policy: . after( reloadDate) )
You can’t perform that action at this time.
0 commit comments