Skip to content

Commit f0af7d8

Browse files
committed
Move hasChangesExcludingImageUploads to private extension
1 parent a05df4a commit f0af7d8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -629,13 +629,6 @@ extension ProductFormViewModel {
629629
}
630630
}
631631

632-
func hasChangesExcludingImageUploads() -> Bool {
633-
let hasProductChanges = product.product.copy(images: []) != originalProduct.product.copy(images: [])
634-
let hasUploadedImageChanges = product.images.map(\.imageID) != originalProduct.images.map(\.imageID)
635-
return hasProductChanges || hasUploadedImageChanges || password != originalPassword || isNewTemplateProduct()
636-
637-
}
638-
639632
func duplicateProduct(onCompletion: @escaping (Result<ProductModel, ProductUpdateError>) -> Void) {
640633

641634
remoteActionUseCase.duplicateProduct(originalProduct: product,
@@ -668,6 +661,14 @@ extension ProductFormViewModel {
668661
// MARK: Background image upload
669662
//
670663
private extension ProductFormViewModel {
664+
665+
func hasChangesExcludingImageUploads() -> Bool {
666+
let hasProductChanges = product.product.copy(images: []) != originalProduct.product.copy(images: [])
667+
let hasUploadedImageChanges = product.images.map(\.imageID) != originalProduct.images.map(\.imageID)
668+
return hasProductChanges || hasUploadedImageChanges || password != originalPassword || isNewTemplateProduct()
669+
670+
}
671+
671672
func replaceProductID(productIDBeforeSave: Int64) {
672673
productImagesUploader.replaceLocalID(siteID: product.siteID,
673674
localID: .product(id: productIDBeforeSave),

0 commit comments

Comments
 (0)