mirror of
https://github.com/aljazceru/goose.git
synced 2026-01-02 05:54:23 +01:00
fix: append the recipe prompt when start recipe in a session (#2599)
This commit is contained in:
@@ -97,6 +97,7 @@ function ChatContent({
|
||||
const [droppedFiles, setDroppedFiles] = useState<string[]>([]);
|
||||
|
||||
const scrollRef = useRef<ScrollAreaHandle>(null);
|
||||
const hasSentPromptRef = useRef(false);
|
||||
|
||||
const {
|
||||
summaryContent,
|
||||
@@ -278,6 +279,14 @@ function ChatContent({
|
||||
}
|
||||
}, [messages]);
|
||||
|
||||
useEffect(() => {
|
||||
const prompt = recipeConfig?.prompt;
|
||||
if (prompt && !hasSentPromptRef.current) {
|
||||
append(prompt);
|
||||
hasSentPromptRef.current = true;
|
||||
}
|
||||
}, [recipeConfig?.prompt, append]);
|
||||
|
||||
// Handle submit
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
window.electron.startPowerSaveBlocker();
|
||||
@@ -476,7 +485,6 @@ function ChatContent({
|
||||
const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col w-full h-screen items-center justify-center">
|
||||
{/* Loader when generating recipe */}
|
||||
|
||||
@@ -285,10 +285,11 @@ const windowMap = new Map<number, BrowserWindow>();
|
||||
|
||||
interface RecipeConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
title: string;
|
||||
description: string;
|
||||
instructions: string;
|
||||
activities: string[];
|
||||
prompt: string;
|
||||
}
|
||||
|
||||
const createChat = async (
|
||||
|
||||
Reference in New Issue
Block a user