From 14ecf202db2203265af746aa5f06cbf593863b36 Mon Sep 17 00:00:00 2001 From: Eric Doughty-Papassideris Date: Tue, 7 May 2024 14:35:15 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20front:=20When=20not=20logged=20i?= =?UTF-8?q?n=20using=20a=20public=20link=20do=20not=20redirect=20to=20logi?= =?UTF-8?q?n=20(#315)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/views/client/body/drive/shared.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tdrive/frontend/src/app/views/client/body/drive/shared.tsx b/tdrive/frontend/src/app/views/client/body/drive/shared.tsx index 4cb8f27d..0246cdd8 100755 --- a/tdrive/frontend/src/app/views/client/body/drive/shared.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/shared.tsx @@ -1,7 +1,6 @@ import { useEffect, useState } from 'react'; import MenusBodyLayer from '@components/menus/menus-body-layer'; -import JWTStorage from '@features/auth/jwt-storage-service'; import Api from '@features/global/framework/api-service'; import Languages from '@features/global/services/languages-service'; import { addApiUrlIfNeeded } from '@features/global/utils/URLUtils'; @@ -136,12 +135,7 @@ const AccessChecker = ({ } }; - useEffect(() => { - (async () => { - await setPublicToken(token || ''); - })(); - }, []); - + useEffect(() => void setPublicToken(token || ''), []); if ((!details?.item?.id && !loading) || accessGranted === false) { return ( @@ -179,5 +173,7 @@ const AccessChecker = ({ ); } + if (!accessGranted) + return <>; return <>{children}; };