Skip to content

Commit cceccda

Browse files
committed
Show non-atomic site error when selecting non-atomic sites from the site picker
1 parent 9315d28 commit cceccda

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

WooCommerce/Classes/Authentication/Epilogue/StorePickerViewController.swift

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,16 @@ extension StorePickerViewController: UITableViewDelegate {
686686
}
687687

688688
guard site.isWooCommerceActive else {
689-
ServiceLocator.analytics.track(.sitePickerNonWooSiteTapped, withProperties: ["is_non_atomic": !site.isJetpackConnected])
690-
tableView.deselectRow(at: indexPath, animated: true)
691-
showNoWooError(for: site)
692-
return
689+
let isNonAtomicSite = !site.isJetpackConnected
690+
ServiceLocator.analytics.track(.sitePickerNonWooSiteTapped, withProperties: ["is_non_atomic": isNonAtomicSite])
691+
692+
if isNonAtomicSite {
693+
showNonAtomicSiteError(for: site)
694+
} else {
695+
showNoWooError(for: site)
696+
}
697+
698+
return tableView.deselectRow(at: indexPath, animated: true)
693699
}
694700

695701
reloadSelectedStoreRows() {
@@ -722,6 +728,13 @@ private extension StorePickerViewController {
722728
}
723729
}
724730

731+
func showNonAtomicSiteError(for site: Site) {
732+
let viewModel = NonAtomicSiteViewModel(site: site, stores: stores)
733+
let errorController = ULErrorViewController(viewModel: viewModel)
734+
navigationController?.show(errorController, sender: nil)
735+
navigationController?.setNavigationBarHidden(false, animated: true)
736+
}
737+
725738
func showNoWooError(for site: Site) {
726739
let viewModel = NoWooErrorViewModel(
727740
site: site,

0 commit comments

Comments
 (0)