homeflowjs 1.1.4 → 1.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -242,8 +242,11 @@ export default class DraggableMap {
242
242
  minimumFractionDigits: 0,
243
243
  maximumFractionDigits: 0,
244
244
  });
245
- const value = rates && rates[currency] * numericPrice || propertyPrice;
245
+ const value = rates?.[currency] != null ? rates[currency] * numericPrice : propertyPrice;
246
246
  const convertedValue = formatter.format(Math.round(value));
247
+ if (!rates) {
248
+ return value;
249
+ };
247
250
 
248
251
  /*
249
252
  Properties which have different currencies set in admin
@@ -255,7 +258,7 @@ export default class DraggableMap {
255
258
  * Converting the property price to the selected currency
256
259
  * this could either be from GBP to EUR, GBP to USD, EUR to USD, etc
257
260
  */
258
- if ( selectedCurrency === 'GBP' && localCurrencyCode !== null && localCurrencyPrice !== null && localCurrencyCode !== 'GBP' ) {
261
+ if ( rates && selectedCurrency === 'GBP' && localCurrencyCode !== null && localCurrencyPrice !== null && localCurrencyCode !== 'GBP' ) {
259
262
  const value = localCurrencyPrice / rates[localCurrencyCode];
260
263
  return formatter.format(Math.round(value));
261
264
  }