abmp-npm 1.1.28 → 1.1.30

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": "abmp-npm",
3
- "version": "1.1.28",
3
+ "version": "1.1.30",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/pages/Home.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //home page code
2
2
  const { location: wixLocation } = require('@wix/site-location');
3
- const { window: wixWindow } = require('@wix/site-window');
3
+ const { window: wixWindow, rendering } = require('@wix/site-window');
4
4
  const { withWarmUpData } = require('psdev-utils/frontend');
5
5
 
6
6
  const { ADDRESS_STATUS_TYPES, DEFAULT_FILTER, DROPDOWN_OPTIONS } = require('../public/consts.js');
@@ -33,6 +33,8 @@ const homePageOnReady = async ({
33
33
  getCompiledFiltersOptions,
34
34
  getNonCompiledFiltersOptions,
35
35
  filterProfiles,
36
+ logMessage,
37
+ veloGetCurrentGeolocation,
36
38
  }) => {
37
39
  const {
38
40
  getParamsMapping,
@@ -52,7 +54,7 @@ const homePageOnReady = async ({
52
54
  updateUrlParams,
53
55
  noSearchCriteria,
54
56
  search,
55
- } = createHomepageUtils(_$w, filterProfiles);
57
+ } = createHomepageUtils(_$w, filterProfiles, veloGetCurrentGeolocation, logMessage);
56
58
  detectMobile();
57
59
  initPageUI();
58
60
  attachEventListeners();
@@ -421,7 +423,8 @@ const homePageOnReady = async ({
421
423
  console.log('filter inside nearByHandler', filter);
422
424
  console.log('success inside nearByHandler', success);
423
425
  if (!success) {
424
- console.log('not success inside nearByHandler');
426
+ const renderingEnv = await rendering.env();
427
+ logMessage(`not success inside nearByHandler in ${renderingEnv}`);
425
428
  multiStateBoxSelector.changeState('nearByState');
426
429
  _$w('#nearBy').checked = false;
427
430
  updateFiltersState();
@@ -459,7 +462,7 @@ const homePageOnReady = async ({
459
462
  await withWarmUpData(
460
463
  'getCompiledFiltersOptions',
461
464
  () => getCompiledFiltersOptions(),
462
- console.log
465
+ logMessage
463
466
  );
464
467
  completeStateList = COMPILED_STATE_LIST;
465
468
  areasOfPracticesList = COMPILED_AREAS_OF_PRACTICES;
@@ -475,7 +478,7 @@ const homePageOnReady = async ({
475
478
  } = await withWarmUpData(
476
479
  'getNonCompiledFiltersOptions',
477
480
  () => getNonCompiledFiltersOptions(),
478
- console.log
481
+ logMessage
479
482
  );
480
483
  completeStateList = _completeStateList;
481
484
  areasOfPracticesList = _areasOfPracticesList;
@@ -1,11 +1,11 @@
1
1
  const { location: wixLocation, queryParams: wixQueryParams } = require('@wix/site-location');
2
- const { window: wixWindow } = require('@wix/site-window');
2
+ const { window: wixWindow, rendering } = require('@wix/site-window');
3
3
 
4
4
  const { DEFAULT_FILTER } = require('../consts.js');
5
5
 
6
6
  const { debouncedFunction } = require('./sharedUtils.js');
7
7
 
8
- const createHomepageUtils = (_$w, filterProfiles) => {
8
+ const createHomepageUtils = (_$w, filterProfiles, veloGetCurrentGeolocation, logMessage) => {
9
9
  const getFiltersSelectors = filterName => ({
10
10
  checkBoxContainerSelector: _$w(`#${filterName}CheckBoxContainer`),
11
11
  searchTextInputSelector: _$w(`#${filterName}TextInput`),
@@ -366,6 +366,12 @@ const createHomepageUtils = (_$w, filterProfiles) => {
366
366
  },
367
367
  };
368
368
  location = await wixWindow.getCurrentGeolocation();
369
+ const renderingEnv = await rendering.env();
370
+
371
+ logMessage(`SDK location inside getAndSetUserLocation in ${renderingEnv}`, location);
372
+
373
+ const veloLocation = await veloGetCurrentGeolocation();
374
+ logMessage(`veloLocation inside getAndSetUserLocation in ${renderingEnv}`, veloLocation);
369
375
  console.log('location inside getAndSetUserLocation', location);
370
376
  const userLat = location.coords?.latitude ?? 0;
371
377
  const userLong = location.coords?.longitude ?? 0;
@@ -381,6 +387,8 @@ const createHomepageUtils = (_$w, filterProfiles) => {
381
387
  };
382
388
  return { success: true, filter };
383
389
  } catch (error) {
390
+ const renderingEnv = await rendering.env();
391
+ logMessage(`error inside getAndSetUserLocation in ${renderingEnv}`, error);
384
392
  console.warn('Failed to get user location in getAndSetUserLocation', error);
385
393
  return { success: false, filter };
386
394
  }