From 40dd9fe1c43fc61f7ee6763c28799b41c195522a Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Thu, 20 Apr 2023 14:57:18 -0300 Subject: [PATCH] regression: Livechat rooms not opening (#28957) * fix: Livechat rooms not opening * Declare livechat room links with room info tab open by default --------- Co-authored-by: Tasso Evangelista --- .../client/views/room/components/body/RoomBody.tsx | 13 +------------ apps/meteor/lib/rooms/roomTypes/livechat.ts | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/apps/meteor/client/views/room/components/body/RoomBody.tsx b/apps/meteor/client/views/room/components/body/RoomBody.tsx index 67a972ed5fd..6ae5be391c1 100644 --- a/apps/meteor/client/views/room/components/body/RoomBody.tsx +++ b/apps/meteor/client/views/room/components/body/RoomBody.tsx @@ -1,5 +1,5 @@ import type { IMessage, IUser } from '@rocket.chat/core-typings'; -import { isEditedMessage, isOmnichannelRoom } from '@rocket.chat/core-typings'; +import { isEditedMessage } from '@rocket.chat/core-typings'; import { useCurrentRoute, usePermission, @@ -262,17 +262,6 @@ const RoomBody = (): ReactElement => { const tabBarRef = useRef(toolbox); tabBarRef.current = toolbox; - useEffect(() => { - const room = roomRef.current; - const tabBar = tabBarRef.current; - Tracker.afterFlush(() => { - // Find a better way to do this, declaratively - if (room && isOmnichannelRoom(room) && tabBar.activeTabBar?.id !== 'room-info') { - tabBar.openRoomInfo(); - } - }); - }, [room._id]); - const debouncedReadMessageRead = useMemo( () => withDebouncing({ wait: 500 })(() => { diff --git a/apps/meteor/lib/rooms/roomTypes/livechat.ts b/apps/meteor/lib/rooms/roomTypes/livechat.ts index 2a03fa0c537..f5edab08acb 100644 --- a/apps/meteor/lib/rooms/roomTypes/livechat.ts +++ b/apps/meteor/lib/rooms/roomTypes/livechat.ts @@ -8,7 +8,7 @@ export function getLivechatRoomType(_coordinator: RoomCoordinator): IRoomTypeCon name: 'live', path: '/live/:id/:tab?/:context?', link({ rid }): Record { - return { id: rid || '' }; + return { id: rid || '', tab: 'room-info' }; }, }, };