From 790284cdb54a88524b21cab8bc883162433fd0c3 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Mon, 24 Jun 2024 17:31:15 +0100 Subject: [PATCH] Toggle edit fix --- next_frontend/components/cases/NotesFeed.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/next_frontend/components/cases/NotesFeed.tsx b/next_frontend/components/cases/NotesFeed.tsx index 16ef5c2c..615b7289 100644 --- a/next_frontend/components/cases/NotesFeed.tsx +++ b/next_frontend/components/cases/NotesFeed.tsx @@ -55,6 +55,7 @@ export default function NotesFeed({ }) { const { assuranceCase, setAssuranceCase } = useStore() const [token] = useLoginToken(); const [edit, setEdit] = useState() + const [editId, setEditId] = useState() const [newComment, setNewComment] = useState() //@ts-ignore @@ -132,7 +133,7 @@ export default function NotesFeed({ }) {

Created On: {moment(new Date(activityItem.created_at)).format('DD/MM/YYYY')}

- {edit ? ( + {edit && editId === activityItem.id ? ( ) : (

{activityItem.content}

@@ -142,7 +143,10 @@ export default function NotesFeed({ }) {
{!edit && (
-