Skip to content

Commit

Permalink
renames to levelCompleteMessageInChatHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarsh-scottlogic committed Mar 21, 2024
1 parent 7b33e8f commit 8b24e05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/controller/chatController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ async function handleChatToGPT(req: OpenAiChatRequest, res: Response) {
req.session.levelState[currentLevel].chatHistory = updatedChatHistory;
req.session.levelState[currentLevel].sentEmails = totalSentEmails;

const levelCompleteMessageHasBeenSent = req.session.levelState[
const levelCompleteMessageInChatHistory = req.session.levelState[
currentLevel
].chatHistory.some((msg) => msg.chatMessageType === 'LEVEL_COMPLETE');
if (updatedChatResponse.wonLevel && !levelCompleteMessageHasBeenSent) {
if (updatedChatResponse.wonLevel && !levelCompleteMessageInChatHistory) {
const levelCompleteMessage = {
chatMessageType: 'LEVEL_COMPLETE',
infoMessage:
Expand Down

0 comments on commit 8b24e05

Please sign in to comment.