-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate Resetting Store for Restart Conversation #1846
Comments
@kunal7898 - reopening this issue, sorry for the confusion! We are concerned there may be a bug on resetting the store in Web Chat, which would prevent users from implementing their own restart button. I am reopening this bug and changing the criteria to track investigation of the store issue. Thanks for filing! |
We are using an old way of passing in the store using We should move to the new way of Repro steps
ExpectedThe transcript should be cleared because the newer store is empty. Also, verify:
ActualThe transcript is not empty. |
Bumped to The Their bug does not repro on I am postponing this bug to 4.6. |
Taking a look at the issue you filed above, the team no longer supports version 6. This should be fixed by WC at the same time as #1818 |
When working on this PR, also do the followings:
|
This is resolved in the latest build from the master branch. I put together a quick sample that resets the store after the user is inactive for five seconds. Note, when the store is replaced, Web Chat dispatches a Bot Framework Web Chat (master) function App() {
const [directLine, setDirectLine] = useState(createDirectLine({}));
const [store, setStore] = useState();
const [timer, setTimer] = useState();
const initConversation = useCallback(() => {
setStore(createStore(
{},
() => next => action => {
if (action.type === 'DIRECT_LINE/INCOMING_ACTIVITY') {
const { payload: { activity: { from: { role }}}} = action;
role === 'user' && setTimer(5000);
}
return next(action);
}));
(async function() {
const res = await fetch('https://webchat-mockbot.azurewebsites.net/directline/token', { method: 'POST' });
const { token } = await res.json();
setDirectLine(createDirectLine({ token }));
})().catch(error => console.log(error));
}, [setStore, setDirectLine, setTimer]);
useEffect(() => {
initConversation();
}, []);
return directLine && (
<div className="App">
<Timer ms={timer} onComplete={initConversation} />
<ReactWebChat className='chat' directLine={directLine} store={store} />
</div>
)
} |
how to achieve the same on webchat without using react? |
@alokraj68 This how to question is better suited for StackOverflow. Please post your question there with the Web Chat and BotFramework tags so the BotFramework Support Team and the community at large can help you work through your issue. |
Hi, Can this sample be implemented in a normal HTML web chat, in the below sample? If we could can anyone please share the code. Thanks |
Hi,
How to add support for restart conversation in webchat(React).
I have requirment where user can click on clear button then all the conversation should delete and
new conversatoin will start.
The text was updated successfully, but these errors were encountered: