Skip to content

Commit

Permalink
add waiting queue feature enabled check
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza98 committed May 14, 2021
1 parent 26a7704 commit d9fe3e3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { callbacks } from '../../../../../app/callbacks/server';
import { LivechatInquiry, Subscriptions, LivechatRooms } from '../../../../../app/models/server';
import { queueInquiry } from '../../../../../app/livechat/server/lib/QueueManager';
import { RoutingManager } from '../../../../../app/livechat/server/lib/RoutingManager';
import { settings } from '../../../../../app/settings/server';

const handleOnAgentAssignmentFailed = async ({ inquiry, room, options }: { inquiry: any; room: any; options: { forwardRoomToDepartment?: string; clienAction?: boolean} }): Promise<any> => {
if (!inquiry || !room) {
Expand All @@ -26,6 +27,10 @@ const handleOnAgentAssignmentFailed = async ({ inquiry, room, options }: { inqui
return;
}

if (!settings.get('Livechat_waiting_queue')) {
return;
}

const { forwardRoomToDepartment: oldDepartmentId } = options;
const { department: newDepartmentId } = inquiry;

Expand Down

0 comments on commit d9fe3e3

Please sign in to comment.