abmp-npm 2.0.19 → 2.0.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pages/Home.js +9 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abmp-npm",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "check-cycles": "madge --circular .",
package/pages/Home.js CHANGED
@@ -211,9 +211,16 @@ const homePageOnReady = async ({
211
211
  // 5) Location text
212
212
  const mainAddress = getMainAddress(itemData.addressDisplayOption, addresses);
213
213
  $item('#location').text = mainAddress || '';
214
+
215
+ // 6) Miles away
216
+ const isNearbyEnabled = _$w('#nearBy').checked;
214
217
  const miles = itemData.distance ?? 0;
215
- $item('#differenceInMiles').text = miles ? miles.toFixed(1) : '';
216
- if (!miles) {
218
+
219
+ if (isNearbyEnabled && miles) {
220
+ $item('#differenceInMiles').text = miles.toFixed(1);
221
+ $item('#milesAwayText').text = 'miles away';
222
+ } else {
223
+ $item('#differenceInMiles').text = '';
217
224
  $item('#milesAwayText').text = '';
218
225
  }
219
226