Skip to content

Commit 573e900

Browse files
committed
OrderSearchStarterVC: Use CellViewModel for selection tracking
1 parent 94617ec commit 573e900

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

WooCommerce/Classes/ViewRelated/Search/Order/OrderSearchStarterViewController.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ extension OrderSearchStarterViewController: UITableViewDataSource {
8383
extension OrderSearchStarterViewController: UITableViewDelegate {
8484

8585
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
86+
let cellViewModel = viewModel.cellViewModel(at: indexPath)
8687
let orderStatus = viewModel.orderStatus(at: indexPath)
8788

88-
analytics.trackSelectionOf(orderStatus: orderStatus)
89+
analytics.trackSelectionOf(orderStatusSlug: cellViewModel.slug)
8990

9091
let ordersViewController = OrdersViewController(
9192
title: orderStatus.name ?? NSLocalizedString("Orders", comment: "Default title for Orders List shown when tapping on the Search filter."),
@@ -111,8 +112,8 @@ extension OrderSearchStarterViewController: KeyboardScrollable {
111112
private extension Analytics {
112113
/// Submit events depicting selection of an `OrderStatus` in the UI.
113114
///
114-
func trackSelectionOf(orderStatus: OrderStatus) {
115-
track(.filterOrdersOptionSelected, withProperties: ["status": orderStatus.slug])
116-
track(.ordersListFilterOrSearch, withProperties: ["filter": orderStatus.slug, "search": ""])
115+
func trackSelectionOf(orderStatusSlug: String) {
116+
track(.filterOrdersOptionSelected, withProperties: ["status": orderStatusSlug])
117+
track(.ordersListFilterOrSearch, withProperties: ["filter": orderStatusSlug, "search": ""])
117118
}
118119
}

0 commit comments

Comments
 (0)