Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-3352] - TIDE Drawer Navigation Bugs #1500

Open
wants to merge 14 commits into
base: WEB-3397-mobile-views
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fallback for empty query value
  • Loading branch information
henry-tp committed Jan 31, 2025
commit e8c52f4830def43a98ffbd763d9d950b3730155e
5 changes: 2 additions & 3 deletions app/core/navutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,14 @@ export const uploadUtils = { launchCustomProtocol };
export const useNavigation = (api, trackMetric) => {
const { query } = useLocation();
const dispatch = useDispatch();
const [initialQuery] = useState(query); // retain query retrieved on component mount
const [initialQuery] = useState(query || {}); // keep a copy of the original value

const clinicFlowActive = useSelector(state => state.blip.clinicFlowActive);
const selectedClinicId = useSelector(state => state.blip.selectedClinicId);
const currentPatientInViewId = useSelector(state => state.blip.currentPatientInViewId);

const patientListLink = getPatientListLink(clinicFlowActive, selectedClinicId, initialQuery, currentPatientInViewId);

const handleBack = () => {
const patientListLink = getPatientListLink(clinicFlowActive, selectedClinicId, initialQuery, currentPatientInViewId);
trackMetric('Clinic - View patient list', { clinicId: selectedClinicId, source: 'Patient data' });
dispatch(push(patientListLink));
};
Expand Down