Skip to content

Commit

Permalink
fix: delay login
Browse files Browse the repository at this point in the history
  • Loading branch information
JadlionHD committed Sep 7, 2024
1 parent 125ebf9 commit ed50f31
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/routes/player/login/dashboard/LoginDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/routes/player/login/dashboard/RegisterDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/routes/player/login/dashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
<div className="m-auto w-[300px] mt-[20vh]">
<div className="m-auto w-[300px] mt-10 mb-[8vh]">
<img src="/banner.png" loading="lazy" />
</div>

Expand Down
4 changes: 4 additions & 0 deletions src/routes/player/login/dashboard/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:root,
[data-theme] {
background-color: rgba(0, 0, 0, 0) !important;
}

0 comments on commit ed50f31

Please sign in to comment.