Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions libraries/botbuilder-dialogs/lib/prompts/prompt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libraries/botbuilder-dialogs/lib/prompts/prompt.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 17 additions & 3 deletions libraries/botbuilder-dialogs/lib/waterfall.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libraries/botbuilder-dialogs/lib/waterfall.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion libraries/botbuilder-dialogs/src/prompts/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { TurnContext, Activity, Promiseable } from 'botbuilder';
import { TurnContext, Activity, Promiseable, ActivityTypes } from 'botbuilder';
import { PromptValidator } from 'botbuilder-prompts';
import { DialogContext } from '../dialogContext';
import { Control } from '../control';
Expand Down Expand Up @@ -44,6 +44,11 @@ export abstract class Prompt<C extends TurnContext> extends Control<C> {
}

public dialogContinue(dc: DialogContext<C>): Promise<any> {
// Don't do anything for non-message activities
if (dc.context.activity.type !== ActivityTypes.Message) {
return Promise.resolve();
}

// Recognize value
const instance = dc.instance;
return this.onRecognize(dc, instance.state)
Expand Down
13 changes: 9 additions & 4 deletions libraries/botbuilder-dialogs/src/waterfall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Promiseable, TurnContext } from 'botbuilder';
import { Promiseable, TurnContext, ActivityTypes } from 'botbuilder';
import { Dialog, DialogInstance } from './dialog';
import { DialogContext } from './dialogContext';

Expand Down Expand Up @@ -142,9 +142,14 @@ export class Waterfall<C extends TurnContext> implements Dialog<C> {
}

public dialogContinue(dc: DialogContext<C>): Promise<any> {
const instance = dc.instance as WaterfallInstance<any>;
instance.step += 1
return this.runStep(dc, dc.context.activity.text);
// Don't do anything for non-message activities
if (dc.context.activity.type === ActivityTypes.Message) {
const instance = dc.instance as WaterfallInstance<any>;
instance.step += 1
return this.runStep(dc, dc.context.activity.text);
} else {
return Promise.resolve();
}
}

public dialogResume(dc: DialogContext<C>, result?: any): Promiseable<any> {
Expand Down