From 6c23b98f908e55131e001ec42ac7c7fc5458ce1c Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Sun, 12 Dec 2021 16:29:38 -0600 Subject: [PATCH] completed issue with login user being set incorrectly --- src/components/auth/Login.js | 16 ++++++++++++---- src/components/home/GraphicsBayTrackerHome.js | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js index d3cfc07..0801237 100644 --- a/src/components/auth/Login.js +++ b/src/components/auth/Login.js @@ -7,7 +7,7 @@ export const Login = () => { const [email, set] = useState("") const existDialog = useRef() const history = useHistory() - let [gbt_customer, setgbt_customer] = useState(1) + @@ -21,7 +21,7 @@ export const Login = () => { const handleLogin = (e) => { e.preventDefault() existingUserCheck() - .then(exists => { + .then (exists => { if (exists) { localStorage.setItem("graphicsbaytracker_customer", exists.id) history.push("") @@ -31,7 +31,15 @@ export const Login = () => { }) } +const skipLogin = () => { + const setLocalStorageUser = () => localStorage.setItem("graphicsbaytracker_customer", 1) + const skipToHome = () => history.replace('./GraphicsBayTrackerHome') + return (setLocalStorageUser(), skipToHome()) +} +const redirectToRegister = () => { + history.replace("./Register") +} return ( @@ -61,9 +69,9 @@ export const Login = () => {
- Not a member yet? +
- + diff --git a/src/components/home/GraphicsBayTrackerHome.js b/src/components/home/GraphicsBayTrackerHome.js index 5642a7a..e918d93 100644 --- a/src/components/home/GraphicsBayTrackerHome.js +++ b/src/components/home/GraphicsBayTrackerHome.js @@ -5,6 +5,6 @@ export const GraphicsBayTrackerHome =()=>{ return
- +

GraphicsBayTrackerHome

} \ No newline at end of file