Skip to content

Commit

Permalink
optimized conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
cabaceira committed Oct 23, 2023
1 parent f10b7fc commit ed45988
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class OmnichannelEE extends ServiceClassInternal implements IOmnichannelE
const { _id: roomId } = room;
const restrictedOnHold = settings.get('Livechat_allow_manual_on_hold_upon_agent_engagement_only');
const canRoomBePlacedOnHold = !room.onHold;
const canAgentPlaceOnHold = !room.lastMessage.token;
const canAgentPlaceOnHold = !room.lastMessage?.token;
const canPlaceChatOnHold = canRoomBePlacedOnHold && (!restrictedOnHold || canAgentPlaceOnHold);

if (!room || !isOmnichannelRoom(room)) {
Expand Down

0 comments on commit ed45988

Please sign in to comment.