From 9670980538acb4b2b653c8df84c0def988c855a0 Mon Sep 17 00:00:00 2001 From: Nathan Lewis Date: Wed, 4 Dec 2024 10:59:28 -0600 Subject: [PATCH] fix: use apollosId in the search params instead of generic id --- packages/web-shared/components/Modal/Modal.js | 5 ----- packages/web-shared/providers/NavigationProvider.js | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/web-shared/components/Modal/Modal.js b/packages/web-shared/components/Modal/Modal.js index ee87b69c..5d426d17 100644 --- a/packages/web-shared/components/Modal/Modal.js +++ b/packages/web-shared/components/Modal/Modal.js @@ -26,15 +26,10 @@ function ChurchLogo(props) { const Modal = (props = {}) => { const [state, dispatch] = useModal(); - - console.log('Modal props: ', props); - const ref = useRef(); const imageRef = useRef(); const { id, navigate } = useNavigation(); - console.log('Navigation ID: ', id); - useEffect(() => { // Watch for changes to the `id` search param if (id) { diff --git a/packages/web-shared/providers/NavigationProvider.js b/packages/web-shared/providers/NavigationProvider.js index ea0bc62b..86b01363 100644 --- a/packages/web-shared/providers/NavigationProvider.js +++ b/packages/web-shared/providers/NavigationProvider.js @@ -6,11 +6,11 @@ const NavigationContext = createContext({ id: null, navigate: () => {} }); const NavigationProvider = (props = {}) => { const [searchParams] = useSearchParams(); - const { contentId, feedId } = useParams(); + const { apollosId, contentId, feedId } = useParams(); const shouldUsePathRouter = useShouldUsePathRouter(); const nativeNavigate = useNavigate(); - const id = contentId || feedId || searchParams.get('id'); + const id = contentId || feedId || apollosId || searchParams.get('apollosId'); let navigate = () => {}; if (shouldUsePathRouter) { @@ -31,7 +31,7 @@ const NavigationProvider = (props = {}) => { navigate = ({ id, type } = {}) => { if (id) { nativeNavigate({ - search: `?id=${id}`, + search: `?apollosId=${id}`, }); } else { nativeNavigate({