From c836768d72f539d961ba97c99b6a609b3125b21f Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 24 Oct 2023 18:15:02 +0200 Subject: [PATCH] fix(ui): userbrowser null check --- .../shared/SessionItem/SessionItem.tsx | 102 +++++++++--------- frontend/app/utils/index.ts | 2 +- 2 files changed, 55 insertions(+), 49 deletions(-) diff --git a/frontend/app/components/shared/SessionItem/SessionItem.tsx b/frontend/app/components/shared/SessionItem/SessionItem.tsx index 014939e33..bf01f823d 100644 --- a/frontend/app/components/shared/SessionItem/SessionItem.tsx +++ b/frontend/app/components/shared/SessionItem/SessionItem.tsx @@ -15,7 +15,7 @@ import { liveSession, sessions as sessionsRoute, session as sessionRoute, - isRoute, + isRoute } from 'App/routes'; import { capitalize } from 'App/utils'; import { Duration } from 'luxon'; @@ -85,7 +85,7 @@ function SessionItem(props: RouteComponentProps & Props) { onClick = null, compact = false, ignoreAssist = false, - bookmarked = false, + bookmarked = false } = props; const { @@ -108,7 +108,7 @@ function SessionItem(props: RouteComponentProps & Props) { metadata, issueTypes, active, - timezone: userTimezone, + timezone: userTimezone } = session; const location = props.location; @@ -142,13 +142,13 @@ function SessionItem(props: RouteComponentProps & Props) { }${sessionRoute(sessionId)}`; copy(sessionPath); toast.success('Session URL copied to clipboard'); - }, + } }, { icon: 'trash', text: 'Remove', - onClick: () => (props.toggleFavorite ? props.toggleFavorite(sessionId) : null), - }, + onClick: () => (props.toggleFavorite ? props.toggleFavorite(sessionId) : null) + } ]; }, []); @@ -160,22 +160,23 @@ function SessionItem(props: RouteComponentProps & Props) { >
e.stopPropagation()} > -
+
{!compact && ( -
+
-
+
!disableUser && !hasUserFilter && hasUserId @@ -185,7 +186,7 @@ function SessionItem(props: RouteComponentProps & Props) { >
@@ -194,7 +195,7 @@ function SessionItem(props: RouteComponentProps & Props) { )}
} - className="w-fit !block" + className='w-fit !block' >
-
+
{!isAssist && ( <> -
- {eventsCount} +
+ {eventsCount} {eventsCount === 0 || eventsCount > 1 ? 'Events' : 'Event'}
- + )}
{live ? : formattedDuration}
-
+
-
- - - - - +
+ {userBrowser && ( + <> + + + + + + )} + + - - + +
{isSessions && ( -
+
)}
-
+
{live && session.isCallActive && session.agentIds!.length > 0 ? ( -
-