From 363ab6ff24ca60945268d2a8e67b069a333e0bb0 Mon Sep 17 00:00:00 2001 From: Pedro Guerreiro Date: Thu, 4 Jul 2024 19:51:31 +0100 Subject: [PATCH] fix: address search not showing recent waypoints while offline --- src/components/AddressSearch/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/AddressSearch/index.tsx b/src/components/AddressSearch/index.tsx index ca026ac21819..2679a550f72f 100644 --- a/src/components/AddressSearch/index.tsx +++ b/src/components/AddressSearch/index.tsx @@ -90,7 +90,7 @@ function AddressSearch( const [isTyping, setIsTyping] = useState(false); const [isFocused, setIsFocused] = useState(false); // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - const [searchValue, setSearchValue] = useState(value || defaultValue || ''); + const [searchValue, setSearchValue] = useState(''); const [locationErrorCode, setLocationErrorCode] = useState(null); const [isFetchingCurrentLocation, setIsFetchingCurrentLocation] = useState(false); const shouldTriggerGeolocationCallbacks = useRef(true); @@ -323,11 +323,11 @@ function AddressSearch( }, []); const filteredPredefinedPlaces = useMemo(() => { - if (!isOffline || !searchValue) { + if (!searchValue) { return predefinedPlaces ?? []; } return predefinedPlaces?.filter((predefinedPlace) => isPlaceMatchForSearch(searchValue, predefinedPlace)) ?? []; - }, [isOffline, predefinedPlaces, searchValue]); + }, [predefinedPlaces, searchValue]); const listEmptyComponent = useCallback( () => (!isTyping ? null : {translate('common.noResultsFound')}),