diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index d6435e6e..2128bb18 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -42,7 +42,7 @@ import { SupabaseConnection } from './SupabaseConnection'; import { ExpoQrModal } from '~/components/workbench/ExpoQrModal'; import { expoUrlAtom } from '~/lib/stores/qrCodeStore'; import { useStore } from '@nanostores/react'; -import { StickToBottom } from '~/lib/hooks'; +import { StickToBottom, useStickToBottomContext } from '~/lib/hooks'; const TEXTAREA_MIN_HEIGHT = 76; @@ -217,6 +217,22 @@ export const BaseChat = React.forwardRef( } }, [providerList, provider]); + function ScrollToBottom() { + const { isAtBottom, scrollToBottom } = useStickToBottomContext(); + + return ( + !isAtBottom && ( + + ) + ); + } + const onApiKeysChange = async (providerName: string, apiKey: string) => { const newApiKeys = { ...apiKeys, [providerName]: apiKey }; setApiKeys(newApiKeys); @@ -387,6 +403,7 @@ export const BaseChat = React.forwardRef( }} /> )} +