diff --git a/apps/meteor/client/hooks/omnichannel/useIsRoomOverMacLimit.tsx b/apps/meteor/client/hooks/omnichannel/useIsRoomOverMacLimit.tsx index 892ada3ab2e4..b86be1d00513 100644 --- a/apps/meteor/client/hooks/omnichannel/useIsRoomOverMacLimit.tsx +++ b/apps/meteor/client/hooks/omnichannel/useIsRoomOverMacLimit.tsx @@ -8,16 +8,16 @@ const getPeriod = (date: Date) => `${date.getFullYear()}-${String(date.getMonth( export const useIsRoomOverMacLimit = (room: IRoom) => { const isOverMacLimit = useIsOverMacLimit(); - const { v: { activity = [] } = {}, t: roomType } = room as IOmnichannelGenericRoom; + const { v: { activity = [] } = {}, t: roomType, open } = room as IOmnichannelGenericRoom; const isContactActive = useMemo(() => { - if (!['l', 'v'].includes(roomType)) { + if (!['l', 'v'].includes(roomType) || !open) { return true; } const currentPeriod = getPeriod(new Date()); return !isOverMacLimit || activity.includes(currentPeriod); - }, [activity, isOverMacLimit, roomType]); + }, [activity, isOverMacLimit, open, roomType]); return !isContactActive; };