diff --git a/src/common/header/containers/HeaderContainer.tsx b/src/common/header/containers/HeaderContainer.tsx index 020bce57..819716d5 100644 --- a/src/common/header/containers/HeaderContainer.tsx +++ b/src/common/header/containers/HeaderContainer.tsx @@ -68,9 +68,13 @@ export function HeaderContainer({ onSearchChange }: HeaderProps): JSX.Element { 📅 The{' '} - Winter 2023 + Fall 2023 {' '} - calendar is now available. Happy scheduling! + and{' '} + + Spring 2024 + {' '} + calendars are now available. Happy scheduling! , ]; return ( diff --git a/src/lib/hooks/useTerm.ts b/src/lib/hooks/useTerm.ts index 4e034138..1e84b587 100644 --- a/src/lib/hooks/useTerm.ts +++ b/src/lib/hooks/useTerm.ts @@ -1,4 +1,4 @@ -import { useMemo } from 'react'; +import { useEffect, useMemo } from 'react'; import { useParams } from 'react-router'; @@ -13,5 +13,11 @@ export const useTerm = (): [Term, (term: string) => void] => { const defaultTerm = useMemo(() => termParam || getCurrentTerm(), [termParam]); const [term, setTerm] = useLocalStorage('user:term', defaultTerm) as [Term, (term: string) => void]; + useEffect(() => { + if (termParam && termParam !== term) { + setTerm(termParam); + } + }, [termParam, term, setTerm]); + return [term, setTerm]; };