FredrikOseberg / react-chatbot-kit

MIT License
297 stars 139 forks source link

saveMessages as HTMLText onClick events on buttons not working #113

Open payalkhobragade opened 1 year ago

payalkhobragade commented 1 year ago

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

jhonatan-dev commented 1 year ago

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

Aryan-Jagadale commented 11 months ago

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

tech-alpinist commented 11 months ago

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

Aryan-Jagadale commented 11 months ago

But how I can merge it in my project?

dnvishnu12 commented 6 months ago

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