From a28956fddf3a4aafbf372ef0c627f930462cc44d Mon Sep 17 00:00:00 2001 From: Cezar Pauxis Date: Mon, 29 Jan 2024 21:54:48 -0300 Subject: [PATCH] docs: reset conversation state when moving to other page --- docs/src/components/PyromodChatSimulator/index.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/components/PyromodChatSimulator/index.jsx b/docs/src/components/PyromodChatSimulator/index.jsx index 3fade5b..e6649d9 100644 --- a/docs/src/components/PyromodChatSimulator/index.jsx +++ b/docs/src/components/PyromodChatSimulator/index.jsx @@ -1,5 +1,6 @@ import {ChatSimulator} from "../ChatSimulator"; import {emit} from "../../utils/event"; +import {useEffect} from "react"; const state = { "waiting_for": "", @@ -42,5 +43,10 @@ const updateProcessor = (update) => { } export const PyromodChatSimulator = ({}) => { + useEffect(() => { + return () => { + state.waiting_for = ""; + } + }, []); return } \ No newline at end of file