Fix message input not updating on chat list switch (#590)

This commit is contained in:
Bryan Lee 2023-04-18 22:11:13 +08:00 committed by GitHub
parent cb922d9dc6
commit 862f74a332
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -134,6 +134,11 @@ export const ChatMessage: FC<Props> = memo(({ message, messageIndex }) => {
}); });
}; };
useEffect(() => {
setMessageContent(message.content);
}, [message.content]);
useEffect(() => { useEffect(() => {
if (textareaRef.current) { if (textareaRef.current) {
textareaRef.current.style.height = 'inherit'; textareaRef.current.style.height = 'inherit';