diff --git a/src/components/Chat/ChatList.tsx b/src/components/Chat/ChatList.tsx index 67e58ae..2791593 100644 --- a/src/components/Chat/ChatList.tsx +++ b/src/components/Chat/ChatList.tsx @@ -32,7 +32,7 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR if (virtuosoRef.current) { - if (virtuosoRef.current && !isAtBottomRef.current) { + if (virtuosoRef.current && !isAtBottomRef.current && hasUnreadMessages) { @@ -76,7 +76,7 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR }) const index = initialMsgs ? initialMsgs.length - 1 : messages.length - 1 if (virtuosoRef.current) { - virtuosoRef.current.scrollToIndex({ index, behavior: 'smooth' }); + virtuosoRef.current.scrollToIndex({ index}); } }; @@ -126,7 +126,7 @@ export const ChatList = ({ initialMessages, myAddress, tempMessages, chatId, onR } return ( -