diff --git a/src/components/Directory/NotesDirectory.jsx b/src/components/Directory/NotesDirectory.jsx index daf39606..1dc56232 100644 --- a/src/components/Directory/NotesDirectory.jsx +++ b/src/components/Directory/NotesDirectory.jsx @@ -19,7 +19,6 @@ const NotesDirectory = ({ refetchProfile, isLoading, contactProfile, // This contactProfile now reliably includes firstName, middleName, lastName, and fullName - contactProfile, // This contactProfile now reliably includes firstName, middleName, lastName, and fullName setProfileContact, }) => { const [IsActive, setIsActive] = useState(true); @@ -30,7 +29,6 @@ const NotesDirectory = ({ const [IsSubmitting, setIsSubmitting] = useState(false); const [showEditor, setShowEditor] = useState(false); - const [showEditor, setShowEditor] = useState(false); const { register, handleSubmit, @@ -71,7 +69,6 @@ const NotesDirectory = ({ const updatedProfile = { ...cached_contactProfile.data, notes: [...(cached_contactProfile.data.notes || []), createdNote], - notes: [...(cached_contactProfile.data.notes || []), createdNote], }; cacheData("Contact Profile", { contactId: contactProfile?.id, @@ -83,10 +80,8 @@ const NotesDirectory = ({ setIsSubmitting(false); showToast("Note added successfully!", "success"); setShowEditor(false); - setShowEditor(false); setIsActive(true); refetch(contactProfile?.id, true); - refetch(contactProfile?.id, true); } catch (error) { setIsSubmitting(false); const msg = @@ -98,11 +93,8 @@ const NotesDirectory = ({ const onCancel = () => { setValue("note", ""); setShowEditor(false); - setValue("note", ""); - setShowEditor(false); }; - const handleSwitch = () => { setIsActive((prevIsActive) => { const newState = !prevIsActive; @@ -121,7 +113,6 @@ const NotesDirectory = ({ : contactNotes || []; return ( -