File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
WooCommerce/Classes/ViewRelated/Products/Cells/Product Images Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ final class ProductImagesHeaderTableViewCell: UITableViewCell {
2121 ///
2222 var onAddImage : ( ( ) -> Void ) ?
2323
24+ /// Keeps track of the cell config to update collection view layout on change.
25+ ///
26+ private var config : ProductImagesCellConfig ?
27+
2428 override func awakeFromNib( ) {
2529 super. awakeFromNib ( )
2630
@@ -120,6 +124,13 @@ private extension ProductImagesHeaderTableViewCell {
120124 collectionView. dataSource = dataSource
121125 collectionView. backgroundColor = . systemColor( . secondarySystemGroupedBackground)
122126 collectionView. showsHorizontalScrollIndicator = false
127+
128+ guard config != self . config else {
129+ return
130+ }
131+
132+ self . config = config
133+
123134 switch config {
124135 case . extendedAddImages:
125136 collectionView. collectionViewLayout = ProductImagesFlowLayout ( itemSize: frame. size, config: config)
You can’t perform that action at this time.
0 commit comments