Skip to content

Commit

Permalink
fix conditions to re-include allow_manual_on_hold
Browse files Browse the repository at this point in the history
  • Loading branch information
cabaceira committed Oct 23, 2023
1 parent db7f775 commit 9dd171b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 9dd171b

Please sign in to comment.