mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
chore: use acc guest instead for action
This commit is contained in:
@@ -3,14 +3,15 @@ import { toast } from "sonner"
|
|||||||
import { LaAccount, PersonalPage } from "@/lib/schema"
|
import { LaAccount, PersonalPage } from "@/lib/schema"
|
||||||
import { ID } from "jazz-tools"
|
import { ID } from "jazz-tools"
|
||||||
import { useNavigate } from "@tanstack/react-router"
|
import { useNavigate } from "@tanstack/react-router"
|
||||||
import { useAccount } from "~/lib/providers/jazz-provider"
|
import { useAccountOrGuest } from "~/lib/providers/jazz-provider"
|
||||||
|
|
||||||
export const usePageActions = () => {
|
export const usePageActions = () => {
|
||||||
const { me } = useAccount()
|
const { me } = useAccountOrGuest()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const newPage = React.useCallback(() => {
|
const newPage = React.useCallback(() => {
|
||||||
if (!me) return
|
if (!me) return
|
||||||
|
if (me._type !== "Account") return
|
||||||
|
|
||||||
const page = PersonalPage.create(
|
const page = PersonalPage.create(
|
||||||
{ public: false, createdAt: new Date(), updatedAt: new Date() },
|
{ public: false, createdAt: new Date(), updatedAt: new Date() },
|
||||||
|
|||||||
Reference in New Issue
Block a user