abmp-npm 1.1.40 → 1.1.41

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.40",
3
+ "version": "1.1.41",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/pages/Home.js CHANGED
@@ -422,6 +422,7 @@ const homePageOnReady = async ({
422
422
  const renderingEnv = await rendering.env();
423
423
  if (!success) {
424
424
  if (renderingEnv !== 'backend') {
425
+ //on Backend environment, geolocation API don't work, so makes no sense to change state for near by
425
426
  multiStateBoxSelector.changeState('nearByState');
426
427
  }
427
428
  _$w('#nearBy').checked = false;
@@ -1,5 +1,5 @@
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
 
@@ -675,12 +675,18 @@ const createHomepageUtils = (_$w, filterProfiles) => {
675
675
  return [];
676
676
  }
677
677
  }
678
- const { success, response, error } = await debouncedFunction({
679
- func: filterProfiles,
680
- debounceTimeout,
681
- timeoutType,
682
- args: { filter, isSearchingNearby },
683
- });
678
+ const renderingEnv = await rendering.env();
679
+ const funcPromise =
680
+ renderingEnv === 'backend'
681
+ ? () => filterProfiles({ filter, isSearchingNearby })
682
+ : () =>
683
+ debouncedFunction({
684
+ func: filterProfiles,
685
+ debounceTimeout,
686
+ timeoutType,
687
+ args: { filter, isSearchingNearby },
688
+ });
689
+ const { success, response, error } = await funcPromise();
684
690
  if (!success) {
685
691
  _$w('#numberOfResults').text = '';
686
692
  console.error('[search] failed with error:', error);