chore: fix demo dep issue

This commit is contained in:
Bereket Engida
2024-10-12 02:25:40 +03:00
parent 90614d42e3
commit ec0fed68dd
3 changed files with 6 additions and 10 deletions

View File

@@ -11,19 +11,16 @@ import {
} from "@/components/ui/card";
import { CheckIcon, XIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { useParams, useRouter } from "next/navigation";
import { Skeleton } from "@/components/ui/skeleton";
import { client, organization } from "@/lib/auth-client";
import { InvitationError } from "./invitation-error";
import { Invitation } from "@/lib/auth-types";
export default function InvitationPage({
params,
}: {
params: {
export default function InvitationPage() {
const params = useParams<{
id: string;
};
}) {
}>();
const router = useRouter();
const [invitationStatus, setInvitationStatus] = useState<
"pending" | "accepted" | "rejected"

View File

@@ -1,5 +1,4 @@
import { SignInButton, SignInFallback } from "@/components/sign-in-btn";
import { headers } from "next/headers";
import { Suspense } from "react";
export default async function Home() {

View File

@@ -49,9 +49,9 @@ function checkOptimisticSession(headers: Headers) {
return !!guessIsSignIn;
}
export function SignInFallback() {
export async function SignInFallback() {
//to avoid flash of unauthenticated state
const guessIsSignIn = checkOptimisticSession(headers());
const guessIsSignIn = checkOptimisticSession(await headers());
return (
<Link
href={guessIsSignIn ? "/dashboard" : "/sign-in"}