@thefittingroom/shop-ui 1.4.0 → 1.4.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.4.0 (2024-07-10T23:28:21.007Z)
2
+ * thefittingroom v1.4.2 (2024-07-19T17:08:28.177Z)
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.3.0 (2024-07-10T23:25:53.913Z)
50
+ * thefittingroom v1.4.0 (2024-07-19T17:07:31.828Z)
51
51
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
52
52
  */
53
53
 
@@ -25240,7 +25240,7 @@ class FirebaseUser {
25240
25240
  const lastLogin = new Date();
25241
25241
  const savedData = savedDoc.exists ? savedDoc.data() : null;
25242
25242
  const lastBrandLogin = (_b = (_a = savedData === null || savedData === void 0 ? void 0 : savedData.brands) === null || _a === void 0 ? void 0 : _a[brandId]) === null || _b === void 0 ? void 0 : _b.last_login;
25243
- if (lastBrandLogin && dayjs(lastLogin).diff(fromFirebaseDate(lastBrandLogin), 'days') <= 7)
25243
+ if (lastBrandLogin && dayjs(lastLogin).diff(fromFirebaseDate(lastBrandLogin), 'seconds') <= 10080)
25244
25244
  return;
25245
25245
  const logins = (_e = (_d = (_c = savedData === null || savedData === void 0 ? void 0 : savedData.brands) === null || _c === void 0 ? void 0 : _c[brandId]) === null || _d === void 0 ? void 0 : _d.logins) !== null && _e !== void 0 ? _e : [];
25246
25246
  logins.push(lastLogin);
@@ -25457,8 +25457,8 @@ class TfrShop {
25457
25457
  if (!taxonomy)
25458
25458
  throw new Error('Taxonomy not found for style garment category id');
25459
25459
  const filteredLocations = !filledLocations.length
25460
- ? taxonomy.garment_measurement_locations.female
25461
- : taxonomy.garment_measurement_locations.female.filter((location) => filledLocations.includes(location));
25460
+ ? taxonomy.measurement_locations.female
25461
+ : taxonomy.measurement_locations.female.filter((location) => filledLocations.includes(location));
25462
25462
  return filteredLocations.map((location) => {
25463
25463
  return this.measurementLocations.has(location) ? this.measurementLocations.get(location) : location;
25464
25464
  });
@@ -25474,8 +25474,8 @@ class TfrShop {
25474
25474
  if (!taxonomy)
25475
25475
  throw new Error('Taxonomy not found for style garment category id');
25476
25476
  const filteredLocations = !filledLocations.length
25477
- ? taxonomy.garment_measurement_locations.female
25478
- : taxonomy.garment_measurement_locations.female.filter((location) => filledLocations.includes(location));
25477
+ ? taxonomy.measurement_locations.female
25478
+ : taxonomy.measurement_locations.female.filter((location) => filledLocations.includes(location));
25479
25479
  return filteredLocations.map((location) => {
25480
25480
  return this.measurementLocations.has(location) ? this.measurementLocations.get(location) : location;
25481
25481
  });
@@ -25537,7 +25537,7 @@ class TfrShop {
25537
25537
  }
25538
25538
  async fetchMeasurementLocations() {
25539
25539
  try {
25540
- const docs = await this.firebase.getDocs('garment_measurement_locations', []);
25540
+ const docs = await this.firebase.getDocs('measurement_locations', []);
25541
25541
  return docs.docs.map((doc) => doc.data());
25542
25542
  }
25543
25543
  catch (error) {
@@ -27144,8 +27144,7 @@ class FittingRoom {
27144
27144
  async setGarmentLocations() {
27145
27145
  var _a, _b;
27146
27146
  const style = await this.getStyle(this.sku);
27147
- const filledLocations = ((_b = (_a = style === null || style === void 0 ? void 0 : style.sizes) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.garment_measurements.map((measurement) => measurement.garment_measurement_location)) ||
27148
- [];
27147
+ const filledLocations = ((_b = (_a = style === null || style === void 0 ? void 0 : style.sizes) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.garment_measurements.map((measurement) => measurement.measurement_location)) || [];
27149
27148
  this.tfrSizeRec.setGarmentLocations(filledLocations);
27150
27149
  }
27151
27150
  async getStyle(brandStyleIdOrSku) {