From e7a31dbb8c8f00b9f941e31d345b39198ce7a6d2 Mon Sep 17 00:00:00 2001 From: sylenien Date: Fri, 13 May 2022 13:39:49 +0200 Subject: [PATCH] fix(ui): refactor sessionitem --- .../shared/SessionItem/SessionItem.tsx | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/frontend/app/components/shared/SessionItem/SessionItem.tsx b/frontend/app/components/shared/SessionItem/SessionItem.tsx index d8e485fbb..09eae802f 100644 --- a/frontend/app/components/shared/SessionItem/SessionItem.tsx +++ b/frontend/app/components/shared/SessionItem/SessionItem.tsx @@ -46,13 +46,13 @@ interface Props { userSessionsCount: number issueTypes: []; active: boolean; - onUserClick: (userId: string, userAnonymousId: string) => null; - hasUserFilter: boolean; - disableUser: boolean; - metaList: Array; - showActive: boolean; - lastPlayedSessionId: string; }, + onUserClick: (userId: string, userAnonymousId: string) => null; + hasUserFilter: boolean; + disableUser: boolean; + metaList: Array; + showActive: boolean; + lastPlayedSessionId: string; } function SessionItem(props: Props) { @@ -60,25 +60,7 @@ function SessionItem(props: Props) { const { timezone } = settingsStore.sessionSettings; const { - session: { - sessionId, - userBrowser, - userOs, - userId, - userAnonymousId, - userDisplayName, - userCountry, - startedAt, - duration, - eventsCount, - viewed, - userDeviceType, - userNumericHash, - live, - metadata, - issueTypes, - active, - }, + session, onUserClick = () => null, hasUserFilter = false, disableUser = false, @@ -87,6 +69,25 @@ function SessionItem(props: Props) { lastPlayedSessionId, } = props; + const { + sessionId, + userBrowser, + userOs, + userId, + userAnonymousId, + userDisplayName, + userCountry, + startedAt, + duration, + eventsCount, + viewed, + userDeviceType, + userNumericHash, + live, + metadata, + issueTypes, + active, + } = session; const location = useLocation(); console.log(location.pathname);