Skip to content

Commit

Permalink
fix: use apollosId in the search params instead of generic id
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewis84 committed Dec 4, 2024
1 parent faf3603 commit 9670980
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions packages/web-shared/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions packages/web-shared/providers/NavigationProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -31,7 +31,7 @@ const NavigationProvider = (props = {}) => {
navigate = ({ id, type } = {}) => {
if (id) {
nativeNavigate({
search: `?id=${id}`,
search: `?apollosId=${id}`,
});
} else {
nativeNavigate({
Expand Down

0 comments on commit 9670980

Please sign in to comment.