File tree Expand file tree Collapse file tree 3 files changed +9
-15
lines changed
WooCommerce/Classes/ViewRelated/Products Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -609,15 +609,7 @@ private extension ProductFormViewController {
609609private extension ProductFormViewController {
610610 func saveProduct( status: ProductStatus ? = nil ) {
611611 let productStatus = status ?? product. status
612- var messageType = viewModel. saveMessageType ( for: productStatus)
613-
614- // Set messageType to `saveVariation`
615- // This will change Progress view title and message for variation save action.
616- // Fix for the issue: https://github.com/woocommerce/woocommerce-ios/issues/4847
617- if viewModel is ProductVariationFormViewModel {
618- messageType = . saveVariation
619- }
620-
612+ let messageType = viewModel. saveMessageType ( for: productStatus)
621613 showSavingProgress ( messageType)
622614 saveImagesAndProductRemotely ( status: status)
623615 }
Original file line number Diff line number Diff line change @@ -153,17 +153,20 @@ extension ProductFormViewModelProtocol {
153153
154154 /// Returns `.publish` when the product does not exists remotely and it's gonna be published for the first time.
155155 /// Returns `.publish` when the product is going to be published from a different status (eg: from draft).
156- /// Returns `.saveVariation` when saving a variation
156+ /// Returns `.saveVariation` when save variation
157157 /// Returns `.save` for any other case.
158158 ///
159159 func saveMessageType( for productStatus: ProductStatus ) -> SaveMessageType {
160160 switch productStatus {
161161 case . publish where !productModel. existsRemotely || originalProductModel. status != . publish:
162162 return . publish
163- case . custom( " variation " ) :
164- return . saveVariation
165163 default :
166- return . save
164+ if self is ProductVariationFormViewModel {
165+ return . saveVariation
166+ }
167+ else {
168+ return . save
169+ }
167170 }
168171 }
169172}
Original file line number Diff line number Diff line change @@ -48,10 +48,9 @@ struct ProductsTabProductViewModel {
4848 /// See more: https://github.com/woocommerce/woocommerce-ios/issues/4846
4949 ///
5050 func createNameLabel( ) -> String {
51- var name = name
5251 if let variationID = productVariation? . productVariationID {
5352 // Add product variation ID with name
54- name = " \( Localization . variationID ( variationID: " \( variationID) " ) ) \n \( name) "
53+ return " \( Localization . variationID ( variationID: " \( variationID) " ) ) \n \( name) "
5554 }
5655 return name
5756 }
You can’t perform that action at this time.
0 commit comments