diff --git a/packages/chat-widget/src/index.tsx b/packages/chat-widget/src/index.tsx index a4858026..7e411d16 100644 --- a/packages/chat-widget/src/index.tsx +++ b/packages/chat-widget/src/index.tsx @@ -394,6 +394,11 @@ const isInputDisabled = (responses: Response[]): boolean => { return new URLSearchParams(payload).get("nlx:input-disabled") === "true"; }; +/** + * IMPORTANT: upload state will get wiped out if there is a newer bot response comes in with different upload configuration. + * This is generally the way conversations are intended to work (choice buttons also do not work by default after new messages come in), + * and it's worth keeping these limitations in mind when designing/maintaining state management. + */ const findActiveUpload = (responses: Response[]): UploadUrl | null => { const lastBotResponse = findLast( (response): response is BotResponse => response.type === "bot",