Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
J164 committed Jan 30, 2025
1 parent b15a22a commit f188667
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
44 changes: 21 additions & 23 deletions app/register/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,42 @@ import { usePathname, useRouter } from "next/navigation";
import { useState, useEffect } from "react";

const Layout = ({ children }: { children: React.ReactNode }) => {
const [isLoading, setIsLoading] = useState(true)
const router = useRouter()
const pathname = usePathname()
const [isAlive, setIsAlive] = useState(true)


const [isLoading, setIsLoading] = useState(true);
const router = useRouter();
const pathname = usePathname();
const [isAlive, setIsAlive] = useState(true);

useEffect(() => {
if (!isAuthenticated()) {
authenticate(pathname)
return
authenticate(pathname);
return;
}

getRegistrationOrDefault()
.then(registration => {
if (registration.hasSubmitted) {
router.push("/profile")
router.push("/profile");
} else if (!isAlive) {
router.push("/closed")
router.push("/closed");
}
})
.finally(() => {
setIsLoading(false)
})
}, [])
setIsLoading(false);
});
}, []);

useEffect(() => {
const fetchRegistrationStatus = async () => {
try {
const response = await getRegistrationStatus()
setIsAlive(response.alive)
} catch (err) {
console.error(err)
}
}
fetchRegistrationStatus()
}, [])
try {
const response = await getRegistrationStatus();
setIsAlive(response.alive);
} catch (err) {
console.error(err);
}
};

fetchRegistrationStatus();
}, []);

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion components/Home/Olympian/Olympian.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ const Olympian: React.FC = () => {
);
};

export default Olympian;
export default Olympian;

0 comments on commit f188667

Please sign in to comment.