From ed50f31e57cc0d5e1532ed824e93da89a55b2320 Mon Sep 17 00:00:00 2001 From: Hendra Gunawan <48410066+JadlionHD@users.noreply.github.com> Date: Sat, 7 Sep 2024 22:59:15 +0700 Subject: [PATCH] fix: delay login --- src/routes/player/login/dashboard/LoginDashboard.tsx | 4 +--- src/routes/player/login/dashboard/RegisterDashboard.tsx | 5 +---- src/routes/player/login/dashboard/index.tsx | 3 ++- src/routes/player/login/dashboard/styles.css | 4 ++++ 4 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 src/routes/player/login/dashboard/styles.css diff --git a/src/routes/player/login/dashboard/LoginDashboard.tsx b/src/routes/player/login/dashboard/LoginDashboard.tsx index 35867d4..8fc520a 100644 --- a/src/routes/player/login/dashboard/LoginDashboard.tsx +++ b/src/routes/player/login/dashboard/LoginDashboard.tsx @@ -57,9 +57,7 @@ export function LoginDashboard({ state }: { state: string }) { setTimeout(() => { setIsOpen(false); }, 3000); - setTimeout(() => { - window.location.href = `/player/growid/login/validate?token=${res.data.token}`; - }, 3500); + window.location.href = `/player/growid/login/validate?token=${res.data.token}`; } catch (e) { alert("Failed to validate"); console.error(e); diff --git a/src/routes/player/login/dashboard/RegisterDashboard.tsx b/src/routes/player/login/dashboard/RegisterDashboard.tsx index b02f06a..156cafa 100644 --- a/src/routes/player/login/dashboard/RegisterDashboard.tsx +++ b/src/routes/player/login/dashboard/RegisterDashboard.tsx @@ -62,13 +62,10 @@ export function RegisterDashboard({ state }: { state: string }) { if (res.status !== 200) throw new Error("Failed to validate"); - console.log("Success, navigating..."); setTimeout(() => { setIsOpen(false); }, 3000); - setTimeout(() => { - window.location.href = `/player/growid/login/validate?token=${res.data.token}`; - }, 3500); + window.location.href = `/player/growid/login/validate?token=${res.data.token}`; } catch (e) { alert("Failed to validate"); console.error(e); diff --git a/src/routes/player/login/dashboard/index.tsx b/src/routes/player/login/dashboard/index.tsx index a189b3d..187b9b9 100644 --- a/src/routes/player/login/dashboard/index.tsx +++ b/src/routes/player/login/dashboard/index.tsx @@ -1,13 +1,14 @@ import { useState } from "react"; import { LoginDashboard } from "./LoginDashboard"; import { RegisterDashboard } from "./RegisterDashboard"; +import "./styles.css"; export function DashboardRoute() { // Check state if login opened then register closed const [openState, setStateOpen] = useState("none"); return ( <> -
+
diff --git a/src/routes/player/login/dashboard/styles.css b/src/routes/player/login/dashboard/styles.css new file mode 100644 index 0000000..976780d --- /dev/null +++ b/src/routes/player/login/dashboard/styles.css @@ -0,0 +1,4 @@ +:root, +[data-theme] { + background-color: rgba(0, 0, 0, 0) !important; +}