Skip to content

Commit

Permalink
Remove changes from last commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbrunvoll committed Feb 28, 2024
1 parent 4f14a5d commit 991dc3e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/page-modules/assistant/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ function AssistantLayout({ children, tripQuery }: AssistantLayoutProps) {
const [isPerformingSearchNavigation, setIsPerformingSearchNavigation] =
useState(false);
const [geolocationError, setGeolocationError] = useState<string | null>(null);
const [defaultFilters, setDefaultFilters] = useState<string[] | null>(null);

// Loading the transport mode filter data here instead of in the component
// avoids the data loading when the filter is mounted which causes the
Expand All @@ -61,11 +60,10 @@ function AssistantLayout({ children, tripQuery }: AssistantLayoutProps) {
);

useEffect(() => {
setDefaultFilters(
tripQuery.transportModeFilter =
transportModeFilter
?.filter((filter) => filter.icon.transportMode !== 'air')
.map((filter) => filter.id) ?? null,
);
.map((filter) => filter.id) ?? null;
}, [transportModeFilter]);

const setValuesWithLoading = async (
Expand Down Expand Up @@ -221,7 +219,7 @@ function AssistantLayout({ children, tripQuery }: AssistantLayoutProps) {
>
<div className={style.alternatives}>
<TransportModeFilter
filterState={defaultFilters}
filterState={tripQuery.transportModeFilter}
data={transportModeFilter}
onChange={onTransportFilterChanged}
/>
Expand Down

0 comments on commit 991dc3e

Please sign in to comment.