react-chatbot-kit icon indicating copy to clipboard operation
react-chatbot-kit copied to clipboard

saveMessages as HTMLText onClick events on buttons not working

Open payalkhobragade opened this issue 3 years ago • 5 comments

hi, @FredrikOseberg I am implementing a chatbot that can save history. OnClick event any of the buttons are not working after closing and reopening the chat window. I am using the same widget to dynamically create chat messages, so using (messages) is not working. Please help saveMessages = (messages,HTMLString) <Chatbot config={getConfig()} actionProvider={ActionProvider} messageParser={MessageParser} headerText='Chat with us!' validator={validateInput} messageHistory={loadMessages()} saveMessages={saveMessages} />

const saveMessages = (messages, HTMLString) => { localStorage.setItem('HTMLString', HTMLString);

}; const loadMessages = () => { const messages = localStorage.getItem('HTMLString'); return messages; };

image

payalkhobragade avatar Aug 29 '22 15:08 payalkhobragade

I also want to know about saving conversation. If you solve the issue, could you let me know?

jhonatan-dev avatar Jul 04 '23 17:07 jhonatan-dev

Hi Guys....!! Did you solved it?

Aryan-Jagadale avatar Jul 30 '23 12:07 Aryan-Jagadale

here is the solution. (https://github.com/FredrikOseberg/react-chatbot-kit/issues/146#event-9880393910)

guess, you should fork from https://github.com/jhonatan-dev/react-chatbot-kit/tree/fix

captain82543 avatar Jul 30 '23 13:07 captain82543

But how I can merge it in my project?

Aryan-Jagadale avatar Jul 30 '23 14:07 Aryan-Jagadale

Any update on this? How to save chat history in the sidebar, same as in chatgpt or bard?

dnvishnu12 avatar Dec 19 '23 12:12 dnvishnu12