Skip to content

Commit cbd9a6c

Browse files
committed
Move clearFilter method to actions extension
1 parent 95a4eae commit cbd9a6c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

WooCommerce/Classes/ViewRelated/Products/ProductsViewController.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,6 @@ private extension ProductsViewController {
253253
}
254254
coordinatingController.start()
255255
}
256-
257-
func clearFilter(sourceBarButtonItem: UIBarButtonItem? = nil, sourceView: UIView? = nil) {
258-
ServiceLocator.analytics.track(.productListClearFiltersTapped)
259-
self.filters = FilterProductListViewModel.Filters(stockStatus: nil,
260-
productStatus: nil,
261-
productType: nil,
262-
productCategory: nil,
263-
numberOfActiveFilters: 0)
264-
}
265256
}
266257

267258
// MARK: - View Configuration
@@ -687,6 +678,11 @@ private extension ProductsViewController {
687678
present(filterProductListViewController, animated: true, completion: nil)
688679
}
689680

681+
func clearFilter(sourceBarButtonItem: UIBarButtonItem? = nil, sourceView: UIView? = nil) {
682+
ServiceLocator.analytics.track(.productListClearFiltersTapped)
683+
self.filters = FilterProductListViewModel.Filters()
684+
}
685+
690686
/// Presents products survey
691687
///
692688
func presentProductsFeedback() {

0 commit comments

Comments
 (0)