From d5ef07b4d115a7ead1d4d106beed269aec05c18e Mon Sep 17 00:00:00 2001 From: dakai Date: Mon, 10 Apr 2023 20:31:18 +0800 Subject: [PATCH] Adjust text for mobile screens in Home component --- app/components/chat.tsx | 9 +++++---- app/components/home.tsx | 8 +++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 6f5fd8413..2f938c8a5 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -535,10 +535,11 @@ export function Chat(props: {}) { const [showPromptModal, setShowPromptModal] = useState(false); // Auto focus - useEffect(() => { - if (sidebarCollapse && isMobileScreen()) return; - inputRef.current?.focus(); - }, [sidebarCollapse]); + //useEffect(() => { + // if (isMobileScreen() && !sidebarCollapse) return; + // inputRef.current?.focus(); + //}, [sidebarCollapse]); + return (
diff --git a/app/components/home.tsx b/app/components/home.tsx index 098067236..7e7af3d1b 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -309,7 +309,13 @@ function _Home() { > } - text={sidebarCollapse ? undefined : Locale.Home.NewChat} + text={ + isMobileScreen() + ? undefined + : sidebarCollapse + ? undefined + : Locale.Home.NewChat + } onClick={() => { createNewSession(); setSideBarCollapse(true);