From 05da2a5872931787ca3720a4f244f69fa81700c5 Mon Sep 17 00:00:00 2001 From: balibabu Date: Mon, 19 Jan 2026 19:09:41 +0800 Subject: [PATCH] Fix: When large models output data rapidly, the scrollbar cannot remain at the bottom. #12701 (#12702) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/hooks/logic-hooks.ts | 2 +- web/src/utils/authorization-util.ts | 2 +- web/src/wrappers/auth.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/hooks/logic-hooks.ts b/web/src/hooks/logic-hooks.ts index 25b2589ff..3c1baccbd 100644 --- a/web/src/hooks/logic-hooks.ts +++ b/web/src/hooks/logic-hooks.ts @@ -409,7 +409,7 @@ export const useScrollToBottom = ( const container = containerRef.current; container.scrollTo({ top: container.scrollHeight - container.clientHeight, - behavior: 'smooth', + behavior: 'auto', }); } }, [containerRef]); diff --git a/web/src/utils/authorization-util.ts b/web/src/utils/authorization-util.ts index 0c9118cd3..227f33b54 100644 --- a/web/src/utils/authorization-util.ts +++ b/web/src/utils/authorization-util.ts @@ -22,7 +22,7 @@ const storage = { localStorage.setItem(Token, value); }, setUserInfo: (value: string | Record) => { - let valueStr = typeof value !== 'string' ? JSON.stringify(value) : value; + const valueStr = typeof value !== 'string' ? JSON.stringify(value) : value; localStorage.setItem(UserInfo, valueStr); }, setItems: (pairs: Record) => { diff --git a/web/src/wrappers/auth.tsx b/web/src/wrappers/auth.tsx index 1d827cf70..052750332 100644 --- a/web/src/wrappers/auth.tsx +++ b/web/src/wrappers/auth.tsx @@ -2,7 +2,7 @@ import { useAuth } from '@/hooks/auth-hooks'; import { redirectToLogin } from '@/utils/authorization-util'; import { Outlet } from 'react-router'; -export default () => { +export default function AuthWrapper() { const { isLogin } = useAuth(); if (isLogin === true) { return ; @@ -11,4 +11,4 @@ export default () => { } return <>; -}; +}