diff --git a/apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx b/apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx index 2f1c90bc1ff02..7be482b2fc32b 100644 --- a/apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx +++ b/apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx @@ -296,9 +296,8 @@ export const useQuickActions = (): { }); const omnichannelRouteConfig = useOmnichannelRouteConfig(); - + const manualOnHoldAllowed = useSetting('Livechat_allow_manual_on_hold'); const hasManagerRole = useRole('livechat-manager'); - const roomOpen = room?.open && (room.u?._id === uid || hasManagerRole) && room?.lastMessage?.t !== 'livechat-close'; const canMoveQueue = !!omnichannelRouteConfig?.returnQueue && room?.u !== undefined; const canForwardGuest = usePermission('transfer-livechat-guest'); @@ -310,7 +309,7 @@ export const useQuickActions = (): { const restrictedOnHold = useSetting('Livechat_allow_manual_on_hold_upon_agent_engagement_only'); const canRoomBePlacedOnHold = !room.onHold && room.u; const canAgentPlaceOnHold = !room.lastMessage.token; - const canPlaceChatOnHold = canRoomBePlacedOnHold && (!restrictedOnHold || canAgentPlaceOnHold); + const canPlaceChatOnHold = manualOnHoldAllowed && canRoomBePlacedOnHold && (!restrictedOnHold || canAgentPlaceOnHold); const hasPermissionButtons = (id: string): boolean => { switch (id) { diff --git a/apps/meteor/ee/app/livechat-enterprise/server/services/omnichannel.internalService.ts b/apps/meteor/ee/app/livechat-enterprise/server/services/omnichannel.internalService.ts index 96428ae85d5b2..0f63b852a20c1 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/services/omnichannel.internalService.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/services/omnichannel.internalService.ts @@ -45,11 +45,9 @@ export class OmnichannelEE extends ServiceClassInternal implements IOmnichannelE if (room.onHold) { throw new Error('error-room-is-already-on-hold'); } - if (!canPlaceChatOnHold) { throw new Error('error-contact-sent-last-message-so-cannot-place-on-hold'); } - if (!room.servedBy) { throw new Error('error-unserved-rooms-cannot-be-placed-onhold'); }