From c8b70d13f55e9a8f9365608af8fecc4c947959c6 Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Wed, 15 Nov 2023 11:50:29 -0500 Subject: [PATCH] fix error with trailing slash (#5522) * fix error with trailing slash * eslint * eslint again --- app/javascript/routes/AuthenticatedOnly.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/javascript/routes/AuthenticatedOnly.jsx b/app/javascript/routes/AuthenticatedOnly.jsx index f8fde5ed10..c8997407b4 100644 --- a/app/javascript/routes/AuthenticatedOnly.jsx +++ b/app/javascript/routes/AuthenticatedOnly.jsx @@ -15,9 +15,7 @@ // with Greenlight; if not, see . import React from 'react'; -import { - Navigate, Outlet, useLocation, useMatch, -} from 'react-router-dom'; +import { Navigate, Outlet, useMatch } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { toast } from 'react-toastify'; import { useAuth } from '../contexts/auth/AuthProvider'; @@ -26,7 +24,6 @@ import useDeleteSession from '../hooks/mutations/sessions/useDeleteSession'; export default function AuthenticatedOnly() { const { t } = useTranslation(); const currentUser = useAuth(); - const location = useLocation(); const roomsMatch = useMatch('/rooms/:friendlyId'); const superAdminMatch = useMatch('/admin/*'); const deleteSession = useDeleteSession({ showToast: false }); @@ -46,7 +43,7 @@ export default function AuthenticatedOnly() { // Custom logic to redirect from Rooms page to join page if the user isn't signed in if (!currentUser.signed_in && roomsMatch) { - return ; + return ; } if (currentUser.signed_in && currentUser.isSuperAdmin && !superAdminMatch) {