@trackunit/filters-asset-filter-definitions 1.12.20 → 1.12.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.
package/index.cjs.js CHANGED
@@ -2647,7 +2647,8 @@ const usePlacesSearch = ({ localStorageKey = SHARED_LOCATIONS_LOCAL_STORAGE_KEY,
2647
2647
  if (isRecentPlace(selectedPrediction.placeId)) {
2648
2648
  return recentPlaces.find(r => r.placeId === selectedPrediction.placeId);
2649
2649
  }
2650
- if (!placeDetailsData?.placeDetails) {
2650
+ // Wait for fresh data - placeDetailsData may be stale from previous query
2651
+ if (loadingDetails || !placeDetailsData?.placeDetails) {
2651
2652
  return null;
2652
2653
  }
2653
2654
  const details = placeDetailsData.placeDetails;
@@ -2668,7 +2669,7 @@ const usePlacesSearch = ({ localStorageKey = SHARED_LOCATIONS_LOCAL_STORAGE_KEY,
2668
2669
  placeId: selectedPrediction.placeId,
2669
2670
  description: selectedPrediction.description,
2670
2671
  };
2671
- }, [placeDetailsData, selectedPrediction, isRecentPlace, recentPlaces]);
2672
+ }, [placeDetailsData, selectedPrediction, isRecentPlace, recentPlaces, loadingDetails]);
2672
2673
  // List of predictions or recent places
2673
2674
  const places = react.useMemo(() => {
2674
2675
  if (debouncedSearchString) {
package/index.esm.js CHANGED
@@ -2645,7 +2645,8 @@ const usePlacesSearch = ({ localStorageKey = SHARED_LOCATIONS_LOCAL_STORAGE_KEY,
2645
2645
  if (isRecentPlace(selectedPrediction.placeId)) {
2646
2646
  return recentPlaces.find(r => r.placeId === selectedPrediction.placeId);
2647
2647
  }
2648
- if (!placeDetailsData?.placeDetails) {
2648
+ // Wait for fresh data - placeDetailsData may be stale from previous query
2649
+ if (loadingDetails || !placeDetailsData?.placeDetails) {
2649
2650
  return null;
2650
2651
  }
2651
2652
  const details = placeDetailsData.placeDetails;
@@ -2666,7 +2667,7 @@ const usePlacesSearch = ({ localStorageKey = SHARED_LOCATIONS_LOCAL_STORAGE_KEY,
2666
2667
  placeId: selectedPrediction.placeId,
2667
2668
  description: selectedPrediction.description,
2668
2669
  };
2669
- }, [placeDetailsData, selectedPrediction, isRecentPlace, recentPlaces]);
2670
+ }, [placeDetailsData, selectedPrediction, isRecentPlace, recentPlaces, loadingDetails]);
2670
2671
  // List of predictions or recent places
2671
2672
  const places = useMemo(() => {
2672
2673
  if (debouncedSearchString) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/filters-asset-filter-definitions",
3
- "version": "1.12.20",
3
+ "version": "1.12.21",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {