From 8a532f8b7441d90d4bd23e9b4d42d281cced684c Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 23 Jun 2023 15:36:38 +0200 Subject: [PATCH] fix(ui): no sessions message check for siteId --- frontend/app/components/Overview/Overview.tsx | 2 +- .../NoSessionsMessage/NoSessionsMessage.js | 83 +++++++++---------- 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/frontend/app/components/Overview/Overview.tsx b/frontend/app/components/Overview/Overview.tsx index 3bb78a4ce..2014ab905 100644 --- a/frontend/app/components/Overview/Overview.tsx +++ b/frontend/app/components/Overview/Overview.tsx @@ -34,7 +34,7 @@ function Overview({ match: { params } }: IProps) {
- +
diff --git a/frontend/app/components/shared/NoSessionsMessage/NoSessionsMessage.js b/frontend/app/components/shared/NoSessionsMessage/NoSessionsMessage.js index d8158f598..d503a33a9 100644 --- a/frontend/app/components/shared/NoSessionsMessage/NoSessionsMessage.js +++ b/frontend/app/components/shared/NoSessionsMessage/NoSessionsMessage.js @@ -4,52 +4,51 @@ import { connect } from 'react-redux'; import { onboarding as onboardingRoute } from 'App/routes'; import { withRouter } from 'react-router-dom'; import * as routes from '../../../routes'; + const withSiteId = routes.withSiteId; const NoSessionsMessage = (props) => { - const { - sites, - match: { - params: { siteId }, - }, - } = props; - const activeSite = sites.find((s) => s.id == siteId); - const showNoSessions = !!activeSite && !activeSite.recorded; - return ( - <> - {showNoSessions && ( -
-
-
-
- -
-
- It might take a few minutes for first recording to appear. - - Troubleshoot - - . -
- -
-
-
- )} - - ); + const { + sites, + siteId + } = props; + const activeSite = sites.find((s) => s.id === siteId); + const showNoSessions = !!activeSite && !activeSite.recorded; + return ( + <> + {showNoSessions && ( +
+
+
+
+ +
+
+ It might take a few minutes for first recording to appear. + + Troubleshoot + + . +
+ +
+
+
+ )} + + ); }; export default connect((state) => ({ - site: state.getIn(['site', 'siteId']), - sites: state.getIn(['site', 'list']), + site: state.getIn(['site', 'siteId']), + sites: state.getIn(['site', 'list']) }))(withRouter(NoSessionsMessage));