From 752e468c4b740030c7b6d5183953cb43ea6d9df5 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 15 Nov 2022 03:46:25 -0800 Subject: [PATCH] Remove unused cookie code from _app --- pages/_app.tsx | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index c7dd8537..b8cdcf92 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,41 +1,16 @@ -import { useEffect } from 'react' -import { useCookies, CookiesProvider } from 'react-cookie' -import { appWithTranslation } from 'next-i18next' +import { appWithTranslation } from "next-i18next" -import type { AppProps } from 'next/app' -import Layout from '~components/Layout' +import type { AppProps } from "next/app" +import Layout from "~components/Layout" -import { accountState } from '~utils/accountState' - -import '../styles/globals.scss' +import "../styles/globals.scss" function MyApp({ Component, pageProps }: AppProps) { - const [cookies] = useCookies(['account']) - - useEffect(() => { - if (cookies.account) { - console.log(`Logged in as user "${cookies.account.username}"`) - - accountState.account.authorized = true - accountState.account.user = { - id: cookies.account.user_id, - username: cookies.account.username, - picture: '', - element: '', - gender: 0 - } - } else { - console.log(`You are not currently logged in.`) - } - }, [cookies.account]) - - return ( - - - - - - ) + return ( + + + + ) } export default appWithTranslation(MyApp)