Skip to content

Commit

Permalink
docs: reset conversation state when moving to other page
Browse files Browse the repository at this point in the history
  • Loading branch information
usernein committed Jan 30, 2024
1 parent a9392c9 commit a28956f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/components/PyromodChatSimulator/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {ChatSimulator} from "../ChatSimulator";
import {emit} from "../../utils/event";
import {useEffect} from "react";

const state = {
"waiting_for": "",
Expand Down Expand Up @@ -42,5 +43,10 @@ const updateProcessor = (update) => {
}

export const PyromodChatSimulator = ({}) => {
useEffect(() => {
return () => {
state.waiting_for = "";
}
}, []);
return <ChatSimulator updateCallback={updateProcessor} />
}

0 comments on commit a28956f

Please sign in to comment.