happychat-service
Advanced tools
Comparing version 0.10.8-0 to 0.10.8-1
@@ -317,3 +317,8 @@ 'use strict'; | ||
debug('reassign chat to operator', operator.id); | ||
store.dispatch((0, _actions.setChatOperator)(chat.id, operator)); | ||
emitChatOpenToOperator(chat, operator).then(function () { | ||
return store.dispatch((0, _actions.setChatOperator)(chat.id, operator)); | ||
}, function (e) { | ||
return store.dispatch((0, _actions.setChatMissed)(chat.id, e)); | ||
}); | ||
return; | ||
@@ -446,2 +451,8 @@ } | ||
var handleAssignNextChat = function handleAssignNextChat() { | ||
// TODO: check if we have capacity | ||
if (!(0, _selectors2.haveAvailableCapacity)(store.getState())) { | ||
debug('no capacity to assign chat'); | ||
return; | ||
} | ||
if ((0, _selectors.isAssigningChat)(store.getState())) { | ||
@@ -532,4 +543,3 @@ debug('aready assigning chat, wait until complete'); | ||
break; | ||
case _actions.SET_CHAT_CUSTOMER_DISCONNECT: | ||
break; | ||
case _actions.SET_CHAT_MISSED: | ||
case _actions.INSERT_PENDING_CHAT: | ||
@@ -536,0 +546,0 @@ store.dispatch((0, _actions.assignNextChat)()); |
@@ -81,2 +81,4 @@ 'use strict'; | ||
case _actions.SET_CHATS_RECOVERED: | ||
case _actions2.SET_OPERATOR_CAPACITY: | ||
case _actions2.SET_OPERATOR_STATUS: | ||
case _actions2.REMOVE_USER: | ||
@@ -83,0 +85,0 @@ case _actions2.SET_USER_OFFLINE: |
{ | ||
"name": "happychat-service", | ||
"version": "0.10.8-0", | ||
"version": "0.10.8-1", | ||
"description": "Socket.IO based chat server for happychat.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
89183
2047