Skip to content
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

Prompts of the same type seem to activate each other #7

Closed
ryanvolum opened this issue Aug 9, 2017 · 1 comment
Closed

Prompts of the same type seem to activate each other #7

ryanvolum opened this issue Aug 9, 2017 · 1 comment

Comments

@ryanvolum
Copy link

ryanvolum commented Aug 9, 2017

As in the alarm bot sample, I built a dialog to collect some basic information about stocks to be added to a portfolio. I'm basically prompting for tickerSymbol and quantity if I don't have them. My bot collects the ticker symbol and then asks the user for quantity (which I'm currently treating as a string). The issue is that the quantity response (e.g. "50") then gets set as the ticker symbol, and the bot gets stuck in a loop (see screenshot below).

router: (dialog) => first(
        dialog.routeTo(textPrompt, _ => !dialog.state.tickerSymbol && { prompt: "What stock would you like to add to your portfolio?" }, m => {
            if (validateStockName(m.dialogResponse.text, m))
                dialog.state.tickerSymbol = m.dialogResponse.text;
            return reroute(m);
        }),
        dialog.routeTo(textPrompt, _ => !dialog.state.quantity && { prompt: `What quantity of ${dialog.state.tickerSymbol} would you like to add to your portfolio?` }, m => {
            dialog.state.quantity = m.dialogResponse.text;
            return reroute(m);
        }),

image

It seems like activating the second text prompt is effectively activating the first, which takes precedence in order.

@billba
Copy link
Owner

billba commented Aug 12, 2018

Not relevant to latesr version.

@billba billba closed this as completed Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants