Skip to content

Commit

Permalink
Fix search init instanciation with user search context
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Oct 29, 2024
1 parent 17e4757 commit 193e9ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/components/pages/search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ export const SearchUI: React.FC<Props> = ({ language }) => {
} = useTextFilter();

const { dateFilter, setDateFilter } = useDateFilter();
const { searchBbox, setPoints, setSearchBbox, isNavigatedByBrowser } = useListAndMapContext();

const bboxState = bounds ?? searchBbox;

const {
searchResults,
Expand All @@ -80,7 +83,7 @@ export const SearchUI: React.FC<Props> = ({ language }) => {
{
filtersState,
textFilterState,
bboxState: bounds?.toBBoxString() ?? null,
bboxState: bboxState?.toBBoxString() ?? null,
dateFilter,
page,
},
Expand All @@ -94,8 +97,6 @@ export const SearchUI: React.FC<Props> = ({ language }) => {
language,
);

const { setPoints, setSearchBbox, isNavigatedByBrowser } = useListAndMapContext();

useEffect(() => {
if (mapResults) {
setPoints(mapResults);
Expand Down

0 comments on commit 193e9ed

Please sign in to comment.