diff --git a/app/components/home.tsx b/app/components/home.tsx
index c09de3d6..2602df54 100644
--- a/app/components/home.tsx
+++ b/app/components/home.tsx
@@ -130,11 +130,14 @@ export function Chat() {
);
useEffect(() => {
- latestMessageRef.current?.scrollIntoView(false);
+ latestMessageRef.current?.scrollIntoView({
+ behavior: "smooth",
+ block: "end",
+ });
});
return (
-
+
{session.topic}
diff --git a/app/store.ts b/app/store.ts
index e49c0f9c..f230df23 100644
--- a/app/store.ts
+++ b/app/store.ts
@@ -106,8 +106,8 @@ export const useChatStore = create
()(
newSession() {
set((state) => ({
- currentSessionIndex: state.sessions.length,
- sessions: state.sessions.concat([createEmptySession()]),
+ currentSessionIndex: 0,
+ sessions: [createEmptySession()].concat(state.sessions),
}));
},