Skip to content

The open alternative to Salesforce, designed for AI.

Fix flashing title for note (#761)

Emilien Chauvetd7efed9f8945
diff --git a/front/src/modules/activities/right-drawer/components/CommentThread.tsx b/front/src/modules/activities/right-drawer/components/CommentThread.tsx
index d9c00099de6..9deeba785b6 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<string | null | undefined>(undefined);
+ const [title, setTitle] = useState<string | null>(null);
const [hasUserManuallySetTitle, setHasUserManuallySetTitle] =
useState<boolean>(false);
@@ -128,10 +128,10 @@ export function CommentThread({
}
useEffect(() => {
- if (commentThread && !title) {
+ if (commentThread) {
setTitle(commentThread?.title ?? '');
}
- }, [commentThread, title]);
+ }, [commentThread]);
if (!commentThread) {
return <></>;