2
0

️ Reset remembered state if the typebot is updated (#1675)

Wipe stored chat state if a typebot is updated.

Resolves #1508 
Resolves #1427  



https://github.com/user-attachments/assets/7668d6a7-2916-4158-b715-1cccaeaf6ddf

---------

Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
This commit is contained in:
Abhirup Basu
2024-08-16 21:40:47 +05:30
committed by GitHub
parent 29ab812512
commit 17684ee5b7
12 changed files with 48 additions and 7 deletions

View File

@ -96,6 +96,7 @@ export const startChat = async ({
id: typebot.id,
theme: typebot.theme,
settings: typebot.settings,
publishedAt: typebot.publishedAt,
},
messages,
input,

View File

@ -31,5 +31,6 @@ export const findPublicTypebot = ({ publicId }: Props) =>
},
},
},
updatedAt: true,
},
})

View File

@ -18,5 +18,6 @@ export const findTypebot = ({ id, userId }: Props) =>
theme: true,
variables: true,
isArchived: true,
updatedAt: true,
},
})

View File

@ -278,6 +278,7 @@ export const startSession = async ({
theme: sanitizeAndParseTheme(typebot.theme, {
variables: initialState.typebotsQueue[0].typebot.variables,
}),
publishedAt: typebot.updatedAt,
},
dynamicTheme: parseDynamicTheme(newSessionState),
logs: startLogs.length > 0 ? startLogs : undefined,
@ -296,6 +297,7 @@ export const startSession = async ({
theme: sanitizeAndParseTheme(typebot.theme, {
variables: initialState.typebotsQueue[0].typebot.variables,
}),
publishedAt: typebot.updatedAt,
},
messages,
input,