File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
ee/app/livechat-enterprise/server/lib Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 11import './livechat' ;
2+ import './config' ;
23import './startup' ;
34import './visitorStatus' ;
45import './agentStatus' ;
56import '../lib/messageTypes' ;
6- import './config' ;
77import './roomType' ;
88import './hooks/beforeCloseRoom' ;
99import './hooks/beforeDelegateAgent' ;
Original file line number Diff line number Diff line change @@ -27,7 +27,13 @@ export const RoutingManager = {
2727 // queue shouldn't start on CE
2828 } ,
2929
30+ isMethodSet ( ) {
31+ return ! ! this . methodName ;
32+ } ,
33+
3034 setMethodName ( name ) {
35+ const err = new Error ( ) ;
36+ console . log ( err . stack ) ;
3137 this . logger . debug ( `Changing default routing method from ${ this . methodName } to ${ name } ` ) ;
3238 if ( ! this . methods [ name ] ) {
3339 this . logger . warn ( `Cannot change routing method to ${ name } . Selected Routing method does not exists. Defaulting to Manual_Selection` ) ;
Original file line number Diff line number Diff line change @@ -259,8 +259,10 @@ const queueWorker = {
259259 } ,
260260} ;
261261
262+ let omnichannelIsEnabled = false ;
263+
262264function shouldQueueStart ( ) {
263- if ( ! settings . get ( 'Livechat_enabled' ) ) {
265+ if ( ! omnichannelIsEnabled ) {
264266 queueWorker . stop ( ) ;
265267 return ;
266268 }
@@ -276,3 +278,8 @@ function shouldQueueStart() {
276278}
277279
278280RoutingManager . startQueue = shouldQueueStart ;
281+
282+ settings . get ( 'Livechat_enabled' , ( _ , value ) => {
283+ omnichannelIsEnabled = value ;
284+ omnichannelIsEnabled && RoutingManager . isMethodSet ( ) ? shouldQueueStart ( value ) : queueWorker . stop ( ) ;
285+ } ) ;
You can’t perform that action at this time.
0 commit comments