You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a range slider so that the user can control the speed of the messages however when the state changes, the delay for the step doesn't update.
UseSlider function below is using context/reducer to manage state for the slider value which ranges from 1 to 6 and then gets multiplied by 1000 for milliseconds to seconds conversion. It's pulling the initial value but step delay value is not updating when the context changes even though I can see in the logs that the state is definitely changing.
Is there some way where I can dynamically change the 'delay' value for steps in the bot?
{
export default function ChatPrototype() {
const { sliderValue } = useSlider();
return (
<div className='chatBotContainer'>
<ChatBot
steps={[
{
id:'1',
message: "Welcome! It is hoped this will be a wonderful experience for you.",
trigger:'2',
},
{
id:'2',
message: "May I know your name, please?",
trigger:'name',
},
{
id:'name',
user: true,
trigger: '4',
},
{
id: '4',
message: ({previousValue, steps}) => `Hi, ${previousValue}. I'm a chatbot, a software program. I use the name 'Riley'.`,
trigger: 'intro_1',
},
{
id: 'intro_1',
component: <Intro1 />,
waitAction: true,
asMessage: true,
hideInput: true,
delay: (sliderValue *1000),
},
},
The text was updated successfully, but these errors were encountered:
I have a range slider so that the user can control the speed of the messages however when the state changes, the delay for the step doesn't update.
UseSlider function below is using context/reducer to manage state for the slider value which ranges from 1 to 6 and then gets multiplied by 1000 for milliseconds to seconds conversion. It's pulling the initial value but step delay value is not updating when the context changes even though I can see in the logs that the state is definitely changing.
Is there some way where I can dynamically change the 'delay' value for steps in the bot?
The text was updated successfully, but these errors were encountered: