diff --git a/src/nextapp/components/no-gateway-redirect/gateway-toast-handler.tsx b/src/nextapp/components/no-gateway-redirect/gateway-toast-handler.tsx deleted file mode 100644 index b67ca18e5..000000000 --- a/src/nextapp/components/no-gateway-redirect/gateway-toast-handler.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import * as React from 'react'; -import { useToast } from '@chakra-ui/react'; -import { useRouter } from 'next/router'; - -const GatewayToastHandler = () => { - const toast = useToast(); - const router = useRouter(); - - React.useEffect(() => { - const handleRouteChange = () => { - const showToast = localStorage.getItem('showNoGatewayToast'); - if (showToast === 'true') { - toast.closeAll(); - toast({ - title: `First select a Gateway to view that page`, - status: 'error', - isClosable: true, - duration: 5000, - }); - localStorage.removeItem('showNoGatewayToast'); - } - }; - - router.events.on('routeChangeComplete', handleRouteChange); - - return () => { - router.events.off('routeChangeComplete', handleRouteChange); - }; - }, [toast, router]); - - return null; -}; - -export default GatewayToastHandler; \ No newline at end of file diff --git a/src/nextapp/components/no-gateway-redirect/no-gateway-redirect.tsx b/src/nextapp/components/no-gateway-redirect/no-gateway-redirect.tsx deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/nextapp/pages/_app.tsx b/src/nextapp/pages/_app.tsx index 2aeeeca2b..f3bb362ba 100644 --- a/src/nextapp/pages/_app.tsx +++ b/src/nextapp/pages/_app.tsx @@ -31,7 +31,6 @@ import '@/shared/styles/global.css'; import { AppWrapper } from './context'; import '../../mocks'; import CompleteProfile from '@/components/complete-profile'; -import GatewayToastHandler from '@/components/no-gateway-redirect/gateway-toast-handler'; const footerItems = [ { href: 'http://www2.gov.bc.ca/gov/content/home', text: 'Home' }, @@ -115,7 +114,6 @@ const App: React.FC = ({ Component, pageProps }) => { }} > -