Skip to content

Commit 1bf66d3

Browse files
authored
Merge pull request #7459 from woocommerce/issue/adjust-orders-report-request-frequency
Adjust orders report request frequency
2 parents 0eda7b2 + a4885de commit 1bf66d3

File tree

5 files changed

+1
-24
lines changed

5 files changed

+1
-24
lines changed

WooCommerce/Classes/Authentication/Epilogue/SwitchStoreUseCase.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ final class SwitchStoreUseCase: SwitchStoreUseCaseProtocol {
4343
logOutOfCurrentStore {
4444
self.finalizeStoreSelection(storeID)
4545

46-
// Reload orders badge
47-
NotificationCenter.default.post(name: .ordersBadgeReloadRequired, object: nil)
4846
onCompletion(true)
4947
}
5048
}

WooCommerce/Classes/ViewModels/MainTabViewModel.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ final class MainTabViewModel {
8383
func startObservingOrdersCount() {
8484
observeBadgeRefreshNotifications()
8585
updateBadgeFromCache()
86-
requestBadgeCount()
8786
}
8887

8988
/// Loads the the hub Menu tab badge and listens to any change to update it

WooCommerce/Classes/ViewRelated/Orders/OrderListViewController.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ final class OrderListViewController: UIViewController, GhostableViewController {
161161
override func viewWillAppear(_ animated: Bool) {
162162
super.viewWillAppear(animated)
163163

164-
viewModel.syncOrderStatuses()
165-
166164
syncingCoordinator.resynchronize(reason: SyncReason.viewWillAppear.rawValue)
167165

168166
// Fix any incomplete animation of the refresh control
@@ -304,7 +302,7 @@ extension OrderListViewController {
304302
@objc func pullToRefresh(sender: UIRefreshControl) {
305303
ServiceLocator.analytics.track(.ordersListPulledToRefresh)
306304
delegate?.orderListViewControllerWillSynchronizeOrders(self)
307-
viewModel.syncOrderStatuses()
305+
NotificationCenter.default.post(name: .ordersBadgeReloadRequired, object: nil)
308306
syncingCoordinator.resynchronize(reason: SyncReason.pullToRefresh.rawValue) {
309307
sender.endRefreshing()
310308
}

WooCommerce/Classes/ViewRelated/Orders/OrderListViewModel.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,6 @@ final class OrderListViewModel {
240240
)
241241
}
242242

243-
/// Fetch all `OrderStatus` from the API
244-
///
245-
func syncOrderStatuses() {
246-
let action = OrderStatusAction.retrieveOrderStatuses(siteID: siteID) { result in
247-
if case let .failure(error) = result {
248-
DDLogError("⛔️ Order List — Error synchronizing order statuses: \(error)")
249-
}
250-
}
251-
252-
stores.dispatch(action)
253-
}
254-
255243
func updateFilters(filters: FilterOrderListViewModel.Filters?) {
256244
self.filters = filters
257245
}

WooCommerce/Classes/ViewRelated/Orders/OrdersRootViewController.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ final class OrdersRootViewController: UIViewController {
102102
}
103103
}
104104

105-
override func viewWillAppear(_ animated: Bool) {
106-
super.viewWillAppear(animated)
107-
108-
ServiceLocator.pushNotesManager.resetBadgeCount(type: .storeOrder)
109-
}
110-
111105
override var shouldShowOfflineBanner: Bool {
112106
if featureFlagService.isFeatureFlagEnabled(.splitViewInOrdersTab) {
113107
return false

0 commit comments

Comments
 (0)