Something went wrong. Try again.
a tool for shared writing and social publishing
Something went wrong. Try again.
590 B · 20 lines
TSX
123456789101112131415161718192021"use client";
import { addDocToHome } from "app/(home-pages)/home/storage";import { useIdentityData } from "components/IdentityProvider";import { useEffect } from "react";import { useReplicache } from "src/replicache";
export function AddLeafletToHomepage() { let { permission_token } = useReplicache(); let { identity } = useIdentityData(); useEffect(() => { if (identity) return; if (permission_token.permission_token_rights[0].write) { try { addDocToHome(permission_token); } catch (e) {} } }, [permission_token, identity]); return null;}