Skip to content

Commit

Permalink
v3.2.2 - fixing context updates in interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
patapizza committed Apr 19, 2016
1 parent 82ec48f commit bae63e9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v3.2.2

- fixing context not updated in interactive mode
- fixing array values in context
- create readline interface only in interactive mode

## v3.2.0

Unifying action parameters.
Expand Down
6 changes: 4 additions & 2 deletions lib/wit.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const Wit = function(token, actions, logger) {

this.interactive = (initContext, maxSteps) => {
const sessionId = uuid.v1();
const context = typeof initContext === 'object' ? initContext : {};
this.context = typeof initContext === 'object' ? initContext : {};
const steps = maxSteps ? maxSteps : DEFAULT_MAX_STEPS;
this.rl = readline.createInterface({
input: process.stdin,
Expand All @@ -273,10 +273,12 @@ const Wit = function(token, actions, logger) {
this.runActions(
sessionId,
msg,
context,
this.context,
(error, context) => {
if (error) {
l.error(error);
} else {
this.context = context;
}
this.rl.prompt();
this.rl.write(null, {ctrl: true, name: 'e'});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-wit",
"version": "3.2.0",
"version": "3.2.2",
"description": "Wit.ai Node.js SDK",
"keywords": [
"wit",
Expand Down

0 comments on commit bae63e9

Please sign in to comment.