From de2a738f4d0b29945237e36c38f191b66ae743dc Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Wed, 12 May 2021 12:48:27 -0300 Subject: [PATCH] [FIX] Close stream properly at Omnichannel room when move to queue (#22015) Co-authored-by: Guilherme Gazzo --- app/ui-cached-collection/client/models/CachedCollection.js | 3 ++- .../room/Header/Omnichannel/QuickActions/QuickActions.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/ui-cached-collection/client/models/CachedCollection.js b/app/ui-cached-collection/client/models/CachedCollection.js index 107024926b7..1ef9d99624c 100644 --- a/app/ui-cached-collection/client/models/CachedCollection.js +++ b/app/ui-cached-collection/client/models/CachedCollection.js @@ -282,7 +282,8 @@ export class CachedCollection extends Emitter { }); } if (room) { - RoomManager.close(room.t + room.name); + room.name && RoomManager.close(room.t + room.name); + !room.name && RoomManager.close(room.t + room._id); } this.collection.remove(record._id); } else { diff --git a/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx b/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx index 4c0d67d484a..ce615b95d07 100644 --- a/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx +++ b/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx @@ -13,6 +13,7 @@ import React, { } from 'react'; import toastr from 'toastr'; +import { RoomManager } from '../../../../../../app/ui-utils/client'; import { handleError } from '../../../../../../app/utils/client'; import { IRoom } from '../../../../../../definition/IRoom'; import PlaceChatOnHoldModal from '../../../../../../ee/app/livechat-enterprise/client/components/modals/PlaceChatOnHoldModal'; @@ -92,8 +93,7 @@ const QuickActions: FC = ({ room, className }) => { try { await requestTranscript(rid, email, subject); closeModal(); - Session.set('openedRoom', null); - FlowRouter.go('/home'); + RoomManager.close(`l${rid}`); toastr.success(t('Livechat_transcript_has_been_requested')); } catch (error) { handleError(error);