diff --git a/components/threads.tsx b/components/threads.tsx index 1221b4df..7ffdef35 100644 --- a/components/threads.tsx +++ b/components/threads.tsx @@ -12,6 +12,7 @@ interface ThreadsProps { const Threads: React.FC = () => { const { setScript, + setScriptContent, setThread, threads, setScriptId, @@ -22,6 +23,7 @@ const Threads: React.FC = () => { const [isCollapsed, setIsCollapsed] = useState(false); const handleRun = async (script: string, id: string, scriptId: string) => { + setScriptContent(null); setScript(script); setThread(id); setScriptId(scriptId); diff --git a/contexts/script.tsx b/contexts/script.tsx index 427312a3..cef2f907 100644 --- a/contexts/script.tsx +++ b/contexts/script.tsx @@ -30,6 +30,7 @@ interface ScriptContextState { subTool: string; setSubTool: React.Dispatch>; setScript: React.Dispatch>; + setScriptContent: React.Dispatch>; tool: Tool; setTool: React.Dispatch>; showForm: boolean; @@ -269,6 +270,7 @@ const ScriptContextProvider: React.FC = ({ setScriptId, script, setScript, + setScriptContent, workspace, setWorkspace, tool,