prg-chatbot
Advanced tools
Comparing version 0.8.1 to 0.8.2
{ | ||
"name": "prg-chatbot", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "Facebook Messenger Chatbot Framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -130,3 +130,3 @@ /* | ||
return this._loadState(senderId, pageId) | ||
.then(stateObject => this._ensureUserProfileLoaded(senderId, stateObject)) | ||
.then(stateObject => this._ensureUserProfileLoaded(senderId, pageId, stateObject)) | ||
.then(stateObject => this._getOrCreateToken(senderId, stateObject)) | ||
@@ -172,3 +172,3 @@ .then(({ token, stateObject }) => { | ||
_ensureUserProfileLoaded (senderId, stateObject) { | ||
_ensureUserProfileLoaded (senderId, pageId, stateObject) { | ||
if (stateObject.state | ||
@@ -180,3 +180,3 @@ && stateObject.state.user | ||
} | ||
return this._ensureUserBound(stateObject, senderId); | ||
return this._ensureUserBound(stateObject, senderId, pageId); | ||
} | ||
@@ -189,3 +189,3 @@ | ||
_ensureUserBound (stateObject, senderId) { | ||
_ensureUserBound (stateObject, senderId, pageId) { | ||
if (!this.userLoader) { | ||
@@ -195,3 +195,3 @@ return stateObject; | ||
const state = stateObject; | ||
return this.userLoader.loadUser(senderId) | ||
return this.userLoader.loadUser(senderId, pageId) | ||
.then((user) => { | ||
@@ -198,0 +198,0 @@ state.state.user = user; |
133490