Skip to content

Commit 13044f7

Browse files
committed
Friday...
1 parent 52fbfe6 commit 13044f7

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

app/livechat/server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import './livechat';
2+
import './config';
23
import './startup';
34
import './visitorStatus';
45
import './agentStatus';
56
import '../lib/messageTypes';
6-
import './config';
77
import './roomType';
88
import './hooks/beforeCloseRoom';
99
import './hooks/beforeDelegateAgent';

app/livechat/server/lib/RoutingManager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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`);

ee/app/livechat-enterprise/server/lib/LivechatEnterprise.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,10 @@ const queueWorker = {
259259
},
260260
};
261261

262+
let omnichannelIsEnabled = false;
263+
262264
function shouldQueueStart() {
263-
if (!settings.get('Livechat_enabled')) {
265+
if (!omnichannelIsEnabled) {
264266
queueWorker.stop();
265267
return;
266268
}
@@ -276,3 +278,8 @@ function shouldQueueStart() {
276278
}
277279

278280
RoutingManager.startQueue = shouldQueueStart;
281+
282+
settings.get('Livechat_enabled', (_, value) => {
283+
omnichannelIsEnabled = value;
284+
omnichannelIsEnabled && RoutingManager.isMethodSet() ? shouldQueueStart(value) : queueWorker.stop();
285+
});

0 commit comments

Comments
 (0)