From c84615a085656a8664e213ecdb12276fbc452d99 Mon Sep 17 00:00:00 2001 From: aadalal <57609353+AaDalal@users.noreply.github.com> Date: Sat, 8 Jun 2024 18:48:21 -0400 Subject: [PATCH] fix SSR of PDP --- frontend/degree-plan/components/Dock/Dock.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/degree-plan/components/Dock/Dock.tsx b/frontend/degree-plan/components/Dock/Dock.tsx index 69938d32..44aa1cc5 100644 --- a/frontend/degree-plan/components/Dock/Dock.tsx +++ b/frontend/degree-plan/components/Dock/Dock.tsx @@ -15,6 +15,7 @@ import AccountIndicator from "pcx-shared-components/src/accounts/AccountIndicato import _ from 'lodash'; import CoursePlanned from '../FourYearPlan/CourseInPlan'; import CourseInDock from './CourseInDock'; +import { useRouter } from 'next/router'; const DockWrapper = styled.div` z-index: 1; @@ -143,6 +144,8 @@ const Dock = ({ user, login, logout, activeDegreeplanId }: DockProps) => { // } // }, [isMount, dockedCourses]); + const { asPath } = useRouter(); + return ( @@ -154,7 +157,7 @@ const Dock = ({ user, login, logout, activeDegreeplanId }: DockProps) => { login={login} logout={logout} dropdownTop={true} - pathname={window.location.pathname} + pathname={asPath} /> { setSearchRuleQuery("");