diff --git a/src/page-modules/assistant/layout.tsx b/src/page-modules/assistant/layout.tsx index 39a5b8ea..60a0d4d1 100644 --- a/src/page-modules/assistant/layout.tsx +++ b/src/page-modules/assistant/layout.tsx @@ -16,7 +16,12 @@ import { PageText, useTranslation } from '@atb/translations'; import { FocusScope } from '@react-aria/focus'; import { AnimatePresence, motion } from 'framer-motion'; import { useRouter } from 'next/router'; -import { FormEventHandler, PropsWithChildren, useState } from 'react'; +import { + FormEventHandler, + PropsWithChildren, + useEffect, + useState, +} from 'react'; import style from './assistant.module.css'; import { FromToTripQuery } from './types'; import { createTripQuery } from './utils'; @@ -54,6 +59,13 @@ function AssistantLayout({ children, tripQuery }: AssistantLayoutProps) { getTransportModeFilter, ); + useEffect(() => { + tripQuery.transportModeFilter = + transportModeFilter + ?.filter((filter: any) => !filter.isUncheckedByDefault) + .map((filter: any) => filter.id) ?? null; + }, [transportModeFilter]); + const setValuesWithLoading = async ( override: Partial, replace = false,