Skip to content

Commit

Permalink
fix identified bugs :)
Browse files Browse the repository at this point in the history
  • Loading branch information
mercedesb committed Jan 10, 2025
1 parent ce57f3c commit 5617207
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/javascript/src/components/PatientDashboardForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default PatientDashboardForm = ({

const autosave = async (updatedData) => {
const updatedPatientData = { ...patientData, ...updatedData }
setPatientData(updatedPatientData)

const putData = {
name: updatedPatientData.name,
Expand All @@ -44,9 +43,9 @@ export default PatientDashboardForm = ({
}
}

const debouncedAutosave = useMemo((params) => {
return debounce(autosave, 300)
}, []);
const debouncedAutosave = (params) => {
return debounce(autosave(params), 300)
};

// Stop the invocation of the debounced function after unmounting
useEffect(() => {
Expand Down

0 comments on commit 5617207

Please sign in to comment.