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 [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 <></>;
|
||||
|
||||
Reference in New Issue
Block a user