botfront / rasa-webchat

A feature-rich chat widget for Rasa and Botfront
https://botfront.io/rasa
Apache License 2.0
962 stars 497 forks source link

How can I clear content or restart a conversation on widget ? #314

Closed luc-tuyishime closed 3 years ago

luc-tuyishime commented 3 years ago

function CustomWidget = () => { return ( <Widget initPayload={"/get_started"} socketUrl={"http://localhost:5500"} socketPath={"/socket.io/"} customData={{"language": "en"}} title={"Title"} /> ) }

Duciwuci commented 3 years ago

Setting the params

params={{
        storage: "session",
      }}

will delete your storage after closing your app or Tab (not on refresh). 😄

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

MatthieuJnon commented 3 years ago

You can also manually clear the local storage on mount and on unmount to make sure that the state is always pristine. localStorage.chat_session = null

LearnCodeZone commented 8 months ago

i have faced same issue but i have fix this using this command localStorage.clear(); check full integration here: https://youtu.be/N_A7e16L6oc