diff --git a/src/games/ai-story/components/chat.tsx b/src/games/ai-story/components/chat.tsx
index aee10c8..6bd3ec7 100644
--- a/src/games/ai-story/components/chat.tsx
+++ b/src/games/ai-story/components/chat.tsx
@@ -1,4 +1,4 @@
-import { useCallback, useContext, useEffect, useRef } from "preact/hooks";
+import { useContext, useEffect, useRef } from "preact/hooks";
import { StateContext } from "../contexts/state";
import { Message } from "./message/message";
import { MessageTools } from "../tools/messages";
@@ -18,16 +18,13 @@ export const Chat = () => {
DOMTools.scrollDown(chatRef.current);
}, [messages.length, lastMessageContent]);
- const handleScroll = useCallback(() => DOMTools.scrollDown(chatRef.current, false), []);
-
return (
- {messages.map((m, i, ms) => (
+ {messages.map((m, i) => (
))}
diff --git a/src/games/ai-story/components/header/connectionEditor.tsx b/src/games/ai-story/components/header/connectionEditor.tsx
index 81b3592..d69cd2e 100644
--- a/src/games/ai-story/components/header/connectionEditor.tsx
+++ b/src/games/ai-story/components/header/connectionEditor.tsx
@@ -73,6 +73,10 @@ export const ConnectionEditor = ({ connection, setConnection }: IProps) => {
}
}, [setConnection, connectionUrl, apiKey, modelName, instruct]);
+ const handleSetInstruct = useInputCallback((instruct: string) => {
+ setConnection({...connection, instruct});
+ }, [setConnection, connection]);
+
const handleBlurUrl = useCallback(() => {
const regex = /^(?:http(s?):\/\/)?(.*?)\/?$/i;
const url = connectionUrl.replace(regex, 'http$1://$2');
@@ -97,7 +101,7 @@ export const ConnectionEditor = ({ connection, setConnection }: IProps) => {
-