Fix flashing title for note (#761)
* Fix flashing title for note * Remove unused check --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -100,7 +100,7 @@ export function CommentThread({
|
|||||||
});
|
});
|
||||||
const commentThread = data?.findManyCommentThreads[0];
|
const commentThread = data?.findManyCommentThreads[0];
|
||||||
|
|
||||||
const [title, setTitle] = useState<string | null | undefined>(undefined);
|
const [title, setTitle] = useState<string | null>(null);
|
||||||
const [hasUserManuallySetTitle, setHasUserManuallySetTitle] =
|
const [hasUserManuallySetTitle, setHasUserManuallySetTitle] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
|
|
||||||
@ -128,10 +128,10 @@ export function CommentThread({
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (commentThread && !title) {
|
if (commentThread) {
|
||||||
setTitle(commentThread?.title ?? '');
|
setTitle(commentThread?.title ?? '');
|
||||||
}
|
}
|
||||||
}, [commentThread, title]);
|
}, [commentThread]);
|
||||||
|
|
||||||
if (!commentThread) {
|
if (!commentThread) {
|
||||||
return <></>;
|
return <></>;
|
||||||
|
|||||||
Reference in New Issue
Block a user