fix: new session should insert at top

This commit is contained in:
Yidadaa
2023-03-11 16:24:17 +08:00
parent b17a6a7f61
commit 4f10b9a60f
2 changed files with 7 additions and 4 deletions

View File

@@ -130,11 +130,14 @@ export function Chat() {
);
useEffect(() => {
latestMessageRef.current?.scrollIntoView(false);
latestMessageRef.current?.scrollIntoView({
behavior: "smooth",
block: "end",
});
});
return (
<div className={styles.chat}>
<div className={styles.chat} key={session.topic}>
<div className={styles["chat-header"]}>
<div>
<div className={styles["chat-header-title"]}>{session.topic}</div>