mirror of
https://github.com/documenso/documenso.git
synced 2025-11-23 05:01:54 +10:00
fix: add public profiles tests
This commit is contained in:
@ -7,7 +7,7 @@ import { ChevronLeft } from 'lucide-react';
|
||||
import { Link, Outlet } from 'react-router';
|
||||
|
||||
import LogoIcon from '@documenso/assets/logo_icon.png';
|
||||
import { useSession } from '@documenso/lib/client-only/providers/session';
|
||||
import { useOptionalSession } from '@documenso/lib/client-only/providers/session';
|
||||
import { cn } from '@documenso/ui/lib/utils';
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
|
||||
@ -21,7 +21,7 @@ export function meta() {
|
||||
}
|
||||
|
||||
export default function PublicProfileLayout() {
|
||||
const session = useSession();
|
||||
const { sessionData } = useOptionalSession();
|
||||
|
||||
const [scrollY, setScrollY] = useState(0);
|
||||
|
||||
@ -37,8 +37,8 @@ export default function PublicProfileLayout() {
|
||||
|
||||
return (
|
||||
<div className="min-h-screen">
|
||||
{session ? (
|
||||
<AuthenticatedHeader user={session.user} teams={session.teams} />
|
||||
{sessionData ? (
|
||||
<AuthenticatedHeader user={sessionData.user} teams={sessionData.teams} />
|
||||
) : (
|
||||
<header
|
||||
className={cn(
|
||||
|
||||
@ -44,7 +44,6 @@ export async function loader({ params }: Route.LoaderArgs) {
|
||||
profileUrl,
|
||||
}).catch(() => null);
|
||||
|
||||
// Todo: Test
|
||||
if (!publicProfile || !publicProfile.profile.enabled) {
|
||||
throw new Response('Not Found', { status: 404 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user