From 802ea20ec4bc4c5cd2acb3a5de2ac4c6a1096694 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Thu, 30 Mar 2023 17:04:32 +0000 Subject: [PATCH] fix: auto scroll on enter --- app/components/home.tsx | 4 +--- app/store/update.ts | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 5494bdce..ab9554e5 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -290,9 +290,7 @@ export function Chat(props: { // for auto-scroll const latestMessageRef = useRef(null); - - // wont scroll while hovering messages - const [autoScroll, setAutoScroll] = useState(false); + const [autoScroll, setAutoScroll] = useState(true); // preview messages const messages = (session.messages as RenderMessage[]) diff --git a/app/store/update.ts b/app/store/update.ts index 69f6cfee..0699369d 100644 --- a/app/store/update.ts +++ b/app/store/update.ts @@ -27,8 +27,7 @@ export const useUpdateStore = create()( try { const data = await (await fetch(FETCH_TAG_URL)).json(); - const sha = data[0].name as string; - const remoteId = sha.substring(0, 7); + const remoteId = data[0].name as string; set(() => ({ lastUpdate: Date.now(), remoteId,