From c8ac094b6a4e423019bfcc6cc95dca5af8faed01 Mon Sep 17 00:00:00 2001 From: Russell Vinegar <38586679+rustyjux@users.noreply.github.com> Date: Wed, 28 Aug 2024 09:38:18 -0700 Subject: [PATCH] scroll to top, fix redirect for gateway detail * add return null * scroll to top of details on nav from /list --- .../components/no-gateway-redirect/no-gateway-redirect.tsx | 1 + src/nextapp/pages/manager/gateways/detail.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/nextapp/components/no-gateway-redirect/no-gateway-redirect.tsx b/src/nextapp/components/no-gateway-redirect/no-gateway-redirect.tsx index 414fdb3db..a9f45fcd6 100644 --- a/src/nextapp/components/no-gateway-redirect/no-gateway-redirect.tsx +++ b/src/nextapp/components/no-gateway-redirect/no-gateway-redirect.tsx @@ -12,6 +12,7 @@ const NoGatewayRedirect = () => { router.push('/manager/gateways/list'); } }, [hasNamespace]); + return null }; export default NoGatewayRedirect; diff --git a/src/nextapp/pages/manager/gateways/detail.tsx b/src/nextapp/pages/manager/gateways/detail.tsx index 1bf000e92..4a93ca708 100644 --- a/src/nextapp/pages/manager/gateways/detail.tsx +++ b/src/nextapp/pages/manager/gateways/detail.tsx @@ -158,6 +158,9 @@ const NamespacesPage: React.FC = () => { text: 'Your Organization and Business Unit will appear here', }; }, [namespace]); + useEffect(() => { + window.scrollTo(0, 0); + }, []); const handleDelete = React.useCallback(async () => { if (user?.namespace) { toast({