Remove tach from aircraft

This commit is contained in:
april
2024-01-10 13:55:54 -06:00
parent 9e4520b218
commit 1958f6dc5f
8 changed files with 392 additions and 59 deletions

View File

@@ -1,7 +1,7 @@
import { TailfinAppShell } from "@/ui/nav/app-shell";
import { useAuth } from "@/util/auth";
import type { MetaFunction } from "@remix-run/node";
import { Outlet, useNavigate } from "@remix-run/react";
import { Outlet, useLocation, useNavigate } from "@remix-run/react";
import {
QueryCache,
QueryClient,
@@ -22,13 +22,15 @@ export default function Index() {
const { user, loading } = useAuth();
const navigate = useNavigate();
const location = useLocation();
useEffect(() => {
if (!loading && !user) {
navigate("/login");
} else {
} else if (location.pathname === "/logbook") {
navigate("/logbook/dashboard");
}
}, [user, loading, navigate]);
}, [user, loading, navigate, location]);
const [queryClient] = useState(
() =>