Skip to content

Commit 79e0212

Browse files
committed
Skip retrieving product password when user is authenticated with site credentials
1 parent b880467 commit 79e0212

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

WooCommerce/Classes/ViewRelated/Products/Edit Product/Product Settings/ProductSettingsViewModel.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ final class ProductSettingsViewModel {
4444
sections = Self.configureSections(productSettings,
4545
productType: product.productType)
4646
/// If nil, we fetch the password from site post API because it was never fetched
47-
if password == nil {
47+
/// Skip this if the user is not authenticated with WPCom.
48+
if password == nil && ServiceLocator.stores.isAuthenticatedWithoutWPCom == false {
4849
retrieveProductPassword(siteID: product.siteID, productID: product.productID) { [weak self] (password, error) in
4950
guard let self = self else {
5051
return

0 commit comments

Comments
 (0)