Skip to content

Commit af2e711

Browse files
committed
Hide product preview flow when loginURL is empty
1 parent 5bdf364 commit af2e711

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

WooCommerce/Classes/ViewRelated/Products/Edit Product/ProductFormViewModel.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ final class ProductFormViewModel: ProductFormViewModelProtocol {
154154

155155
if featureFlagService.isFeatureFlagEnabled(.productsOnboarding),
156156
// The store is hosted on WP.com
157-
stores.sessionManager.defaultSite?.isWordPressComStore == true,
157+
let site = stores.sessionManager.defaultSite,
158+
site.isWordPressComStore,
159+
// In some edge cases loginURL can be empty preventing successful login flow
160+
site.loginURL.isNotEmpty,
158161
// Preview existing drafts or new products, that can be saved as a draft
159162
(canSaveAsDraft() || originalProductModel.status == .draft),
160163
// Do not preview new blank products without any changes

0 commit comments

Comments
 (0)