From 1f4d19d2d2500b0a9e3099bb6fba186c05d815eb Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 19 Oct 2020 00:58:00 -0700 Subject: [PATCH] Small refactoring and logging --- src/components/Header/index.tsx | 5 +---- src/routes/NewRoute/index.tsx | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 7f2ca59f..022e73ba 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -23,6 +23,7 @@ const Header = (props: Props) => { useEffect(() => { if (cookies.user) { setUsername(cookies.user.username) + console.log(`Logged in as user "${cookies.user.username}"`) } }, []) @@ -46,10 +47,6 @@ const Header = (props: Props) => { window.history.replaceState(null, `Grid Tool`, `/`) history.go(0) } - - if (cookies.user != null) { - console.log(`Logged in as user "${cookies.user.username}"`) - } return (