Skip to content

Commit

Permalink
fix(dialogflow): use for await instead of promise.all (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin authored Jul 29, 2020
1 parent 5371c14 commit 5d2fedd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/bottender-dialogflow/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ module.exports = function dialogflow({
// fulfillment by Dialogflow
const fulfillments = getFulfillments(fulfillmentMessages);
if (fulfillments.length > 0) {
await Promise.all(
fulfillments.map(fulfillment => context.sendText(fulfillment))
);
for (const fulfillment of fulfillments) {
// eslint-disable-next-line no-await-in-loop
await context.sendText(fulfillment);
}
return;
}
} else {
Expand Down

0 comments on commit 5d2fedd

Please sign in to comment.