From d7efed9f894570b7451377d2bc108dc8d657cd4e Mon Sep 17 00:00:00 2001 From: Emilien Chauvet Date: Wed, 19 Jul 2023 15:05:54 -0700 Subject: [PATCH] Fix flashing title for note (#761) * Fix flashing title for note * Remove unused check --------- Co-authored-by: Charles Bochet --- .../activities/right-drawer/components/CommentThread.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/src/modules/activities/right-drawer/components/CommentThread.tsx b/front/src/modules/activities/right-drawer/components/CommentThread.tsx index d9c00099d..9deeba785 100644 --- a/front/src/modules/activities/right-drawer/components/CommentThread.tsx +++ b/front/src/modules/activities/right-drawer/components/CommentThread.tsx @@ -100,7 +100,7 @@ export function CommentThread({ }); const commentThread = data?.findManyCommentThreads[0]; - const [title, setTitle] = useState(undefined); + const [title, setTitle] = useState(null); const [hasUserManuallySetTitle, setHasUserManuallySetTitle] = useState(false); @@ -128,10 +128,10 @@ export function CommentThread({ } useEffect(() => { - if (commentThread && !title) { + if (commentThread) { setTitle(commentThread?.title ?? ''); } - }, [commentThread, title]); + }, [commentThread]); if (!commentThread) { return <>;