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 ( -
+
{showScrollButton && ( diff --git a/src/components/Chat/MessageItem.tsx b/src/components/Chat/MessageItem.tsx index bfaf5cc..eabe671 100644 --- a/src/components/Chat/MessageItem.tsx +++ b/src/components/Chat/MessageItem.tsx @@ -13,6 +13,7 @@ import Underline from "@tiptap/extension-underline"; import { executeEvent } from "../../utils/events"; import { WrapperUserAction } from "../WrapperUserAction"; import ReplyIcon from "@mui/icons-material/Reply"; +import { Spacer } from "../../common/Spacer"; export const MessageItem = ({ message, @@ -120,9 +121,10 @@ export const MessageItem = ({ )} {reply && ( + <> + + )} {message?.messageText && (