fix conflict

This commit is contained in:
cyhhao
2023-04-03 14:58:34 +08:00
20 changed files with 334 additions and 171 deletions

View File

@@ -12,14 +12,7 @@ import BotIcon from "../icons/bot.svg";
import AddIcon from "../icons/add.svg";
import DeleteIcon from "../icons/delete.svg";
import {
Message,
SubmitKey,
useChatStore,
ChatSession,
BOT_HELLO,
ROLES,
} from "../store";
import { Message, SubmitKey, useChatStore, BOT_HELLO, ROLES } from "../store";
import {
copyToClipboard,
@@ -462,6 +455,7 @@ export function Chat(props: {
// Auto focus
useEffect(() => {
if (props.sideBarShowing && isMobileScreen()) return;
inputRef.current?.focus();
}, []);
@@ -599,6 +593,7 @@ export function Chat(props: {
if (!isMobileScreen()) return;
setUserInput(message.content);
}}
onMouseOver={() => inputRef.current?.blur()}
>
<Markdown content={message.content} />
</div>
@@ -633,6 +628,9 @@ export function Chat(props: {
setAutoScroll(false);
setTimeout(() => setPromptHints([]), 500);
}}
onMouseOver={() => {
inputRef.current?.focus();
}}
autoFocus={!props?.sideBarShowing}
/>
<IconButton