From 7eda38955e9411e2cd5d94438a70f4adb7a6ae3a Mon Sep 17 00:00:00 2001 From: Aslam H Date: Sat, 9 Nov 2024 16:05:43 +0700 Subject: [PATCH] chore: use acc guest instead for action --- web/app/hooks/actions/use-page-actions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/hooks/actions/use-page-actions.ts b/web/app/hooks/actions/use-page-actions.ts index b3627034..49b09340 100644 --- a/web/app/hooks/actions/use-page-actions.ts +++ b/web/app/hooks/actions/use-page-actions.ts @@ -3,14 +3,15 @@ import { toast } from "sonner" import { LaAccount, PersonalPage } from "@/lib/schema" import { ID } from "jazz-tools" import { useNavigate } from "@tanstack/react-router" -import { useAccount } from "~/lib/providers/jazz-provider" +import { useAccountOrGuest } from "~/lib/providers/jazz-provider" export const usePageActions = () => { - const { me } = useAccount() + const { me } = useAccountOrGuest() const navigate = useNavigate() const newPage = React.useCallback(() => { if (!me) return + if (me._type !== "Account") return const page = PersonalPage.create( { public: false, createdAt: new Date(), updatedAt: new Date() },