homeflowjs 1.1.4 → 1.1.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/package.json
CHANGED
|
@@ -242,8 +242,11 @@ export default class DraggableMap {
|
|
|
242
242
|
minimumFractionDigits: 0,
|
|
243
243
|
maximumFractionDigits: 0,
|
|
244
244
|
});
|
|
245
|
-
const value = rates
|
|
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,8 +258,8 @@ 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' ) {
|
|
259
|
-
const value = localCurrencyPrice / rates[localCurrencyCode];
|
|
261
|
+
if ( rates && selectedCurrency === 'GBP' && localCurrencyCode !== null && localCurrencyPrice !== null && localCurrencyCode !== 'GBP' ) {
|
|
262
|
+
const value = localCurrencyPrice / (rates?.[localCurrencyCode] || 1);
|
|
260
263
|
return formatter.format(Math.round(value));
|
|
261
264
|
}
|
|
262
265
|
|