Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions apps/meteor/app/livechat/server/lib/Helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,8 @@ export const forwardRoomToAgent = async (room: IOmnichannelRoom, transferData: T
// There are some Enterprise features that may interrupt the forwarding process
// Due to that we need to check whether the agent has been changed or not
logger.debug(`Forwarding inquiry ${inquiry._id} to agent ${agent.agentId}`);
const roomTaken = await RoutingManager.takeInquiry(
inquiry,
agent,
{
...(clientAction && { clientAction }),
},
room,
);
const options = typeof clientAction !== 'undefined' ? { clientAction } : undefined;
const roomTaken = await RoutingManager.takeInquiry(inquiry, agent, options, room);
if (!roomTaken) {
logger.debug(`Cannot forward inquiry ${inquiry._id}`);
return false;
Expand Down
9 changes: 7 additions & 2 deletions apps/meteor/app/livechat/server/lib/RoutingManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type Routing = {
'estimatedInactivityCloseTimeAt' | 'message' | 't' | 'source' | 'estimatedWaitingTimeQueue' | 'priorityWeight' | '_updatedAt'
>,
agent: SelectedAgent | null,
options: { clientAction?: boolean; forwardingToDepartment?: { oldDepartmentId?: string; transferData?: any } },
options: { clientAction?: boolean; forwardingToDepartment?: { oldDepartmentId?: string; transferData?: any } } | undefined,
room: IOmnichannelRoom,
): Promise<IOmnichannelRoom | null | void>;
transferRoom(room: IOmnichannelRoom, guest: ILivechatVisitor, transferData: TransferData): Promise<boolean>;
Expand Down Expand Up @@ -266,7 +266,12 @@ export const RoutingManager: Routing = {
inquiry,
options,
});
return cbRoom;

if (cbRoom && cbRoom.chatQueued) {
return cbRoom;
}

return;
}

const result = await LivechatInquiry.takeInquiry(_id, inquiry.lockedAt);
Expand Down
Loading