abmp-npm 1.1.46 → 1.1.48

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.46",
3
+ "version": "1.1.48",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/pages/Home.js CHANGED
@@ -355,6 +355,14 @@ const homePageOnReady = async ({
355
355
  logMessage(`[updateResults][${renderingEnv}] clearing timeout type ${timeoutType}`);
356
356
  clearTimeout(debounceTimeout[timeoutType]);
357
357
  }
358
+ if (renderingEnv === 'backend') {
359
+ //TODO: remove this workaround to fix issue with SSR showing invalid results
360
+ logMessage(
361
+ `[updateResults][${renderingEnv}] backend environment, changing state to loadingState`
362
+ );
363
+ multiStateBoxSelector.changeState('loadingState');
364
+ return;
365
+ }
358
366
  searchResults = await search({
359
367
  filter,
360
368
  pagination,
@@ -721,10 +721,18 @@ const createHomepageUtils = (_$w, filterProfiles, logMessage) => {
721
721
  `[runSearchAndUpdateUI][${renderingEnv}] isSearchingNearby is true , filter`,
722
722
  JSON.stringify({ filter })
723
723
  );
724
+ const nonDebouncedFilterProfiles = async () => {
725
+ try {
726
+ const result = await filterProfiles({ filter, isSearchingNearby });
727
+ return { success: true, response: result };
728
+ } catch (error) {
729
+ return { success: false, error };
730
+ }
731
+ };
724
732
  //Don't run setTimeout on SSR
725
733
  const funcPromise =
726
734
  renderingEnv === 'backend'
727
- ? () => filterProfiles({ filter, isSearchingNearby })
735
+ ? () => nonDebouncedFilterProfiles()
728
736
  : () =>
729
737
  debouncedFunction({
730
738
  func: filterProfiles,