@thefittingroom/shop-ui 1.2.1 → 1.2.2

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.1 (2024-06-18T16:26:11.166Z)
2
+ * thefittingroom v1.2.2 (2024-06-20T18:02:26.202Z)
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.7 (2024-05-16T23:59:30.970Z)
50
+ * thefittingroom v1.1.8 (2024-06-20T17:59:34.232Z)
51
51
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
52
52
  */
53
53
 
@@ -22999,7 +22999,7 @@ class TfrShop {
22999
22999
  const asset = await this.getColorwaySizeAssetFromSku(sku);
23000
23000
  if (!asset)
23001
23001
  throw new Error('No colorway size asset found for sku');
23002
- const styleCategory = await this.getStyleCategory(asset.style_id);
23002
+ const styleCategory = await this.getStyle(asset.style_id);
23003
23003
  if (!styleCategory)
23004
23004
  throw new Error('Style category not found for style id');
23005
23005
  const taxonomy = await this.getGetTaxonomy(styleCategory.style_garment_category_id);
@@ -23028,7 +23028,7 @@ class TfrShop {
23028
23028
  return getFirebaseError(error);
23029
23029
  }
23030
23030
  }
23031
- async getStyleCategory(styleId) {
23031
+ async getStyle(styleId) {
23032
23032
  try {
23033
23033
  const doc = await this.firebase.getDoc('styles', String(styleId));
23034
23034
  return doc;
@@ -36765,6 +36765,10 @@ class FittingRoom {
36765
36765
  get sku() {
36766
36766
  return this.tfrSizeRec.sku;
36767
36767
  }
36768
+ async checkIfPublished(styleId) {
36769
+ const style = await this.tfrShop.getStyle(styleId);
36770
+ return style.is_published;
36771
+ }
36768
36772
  setSku(sku) {
36769
36773
  this.tfrSizeRec.setSku(sku);
36770
36774
  if (this.isLoggedIn)