From 999e8ab660c54a71b34b25bc2af0304d0ab8cc60 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Thu, 11 Aug 2022 15:29:24 -0300 Subject: [PATCH] Regression: Room header not showing room type when not joined (#4427) --- app/views/RoomView/index.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index dc757206..b9bbdd6d 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -550,8 +550,6 @@ class RoomView extends React.Component { parentTitle = getRoomTitle(room); } let subtitle: string | undefined; - let t: string; - let teamMain: boolean | undefined; let teamId: string | undefined; let encrypted: boolean | undefined; let userId: string | undefined; @@ -562,8 +560,6 @@ class RoomView extends React.Component { let departmentId: string | undefined; if ('id' in room) { subtitle = room.topic; - t = room.t; - teamMain = room.teamMain; teamId = room.teamId; encrypted = room.encrypted; ({ id: userId, token } = user); @@ -573,11 +569,12 @@ class RoomView extends React.Component { } if ('source' in room) { - t = room.t; sourceType = room.source; visitor = room.visitor; } + const t = room?.t; + const teamMain = 'teamMain' in room ? room?.teamMain : false; const omnichannelPermissions = { canForwardGuest, canReturnQueue, canPlaceLivechatOnHold }; navigation.setOptions({