@thefittingroom/shop-ui 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * thefittingroom v1.2.4 (2024-06-20T18:21:11.579Z)
2
+ * thefittingroom v1.2.6 (2024-06-20T18:35:48.116Z)
3
3
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
4
4
  */
5
5
  function loadImageRecursive(imageURL, imageURLs) {
@@ -47,7 +47,7 @@ const InitImageSlider = (sliderID, onChange) => {
47
47
  };
48
48
 
49
49
  /*!
50
- * thefittingroom v1.1.11 (2024-06-20T18:20:57.355Z)
50
+ * thefittingroom v1.1.12 (2024-06-20T18:22:43.617Z)
51
51
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
52
52
  */
53
53
 
@@ -23010,11 +23010,12 @@ class TfrShop {
23010
23010
  });
23011
23011
  }
23012
23012
  async getStyleByBrandStyleId(brandStyleId) {
23013
+ var _a, _b;
23013
23014
  try {
23014
23015
  const constraints = [rl('brand_id', '==', this.brandId)];
23015
23016
  constraints.push(rl('brand_style_id', '==', brandStyleId));
23016
23017
  const querySnapshot = await this.firebase.getDocs('styles', constraints);
23017
- return querySnapshot.docs[0].data();
23018
+ return (_b = (_a = querySnapshot.docs) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.data();
23018
23019
  }
23019
23020
  catch (error) {
23020
23021
  return getFirebaseError(error);
@@ -36777,9 +36778,16 @@ class FittingRoom {
36777
36778
  get sku() {
36778
36779
  return this.tfrSizeRec.sku;
36779
36780
  }
36780
- async checkIfPublished(brandStyleId) {
36781
- const style = await this.tfrShop.getStyleByBrandStyleId(brandStyleId);
36782
- return style.is_published;
36781
+ async checkIfPublished(brandStyleIdOrSku) {
36782
+ try {
36783
+ const colorwaySizeAsset = await this.tfrShop.getColorwaySizeAssetFromSku(brandStyleIdOrSku);
36784
+ const style = await this.tfrShop.getStyle(colorwaySizeAsset.style_id);
36785
+ return Boolean(style === null || style === void 0 ? void 0 : style.is_published);
36786
+ }
36787
+ catch (_a) {
36788
+ const style = await this.tfrShop.getStyleByBrandStyleId(brandStyleIdOrSku);
36789
+ return Boolean(style === null || style === void 0 ? void 0 : style.is_published);
36790
+ }
36783
36791
  }
36784
36792
  setSku(sku) {
36785
36793
  this.tfrSizeRec.setSku(sku);