Skip to content

Commit

Permalink
fix: prevent double refresh when switching threads
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhopperlowe committed Sep 9, 2024
1 parent 5c851ac commit fc32008
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contexts/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ const ChatContextProvider: React.FC<ChatContextProps> = ({
setThread(id);
setScriptContent((await getScript(scriptId))?.script || []);
setScriptId(scriptId);
// use `setForceRun` instead of `setShouldRestart` because it triggers the `run` WS event which will reset the messages as well
setForceRun(true);
setShouldRestart(true);
}
};

Expand Down

0 comments on commit fc32008

Please sign in to comment.