a tool for shared writing and social publishing

improve various pub and home error messages

+57 -6
+10 -1
app/home/page.tsx
··· 57 57 permission_token = res.data?.permission_tokens; 58 58 } 59 59 60 - if (!permission_token) return <div>no home page wierdly</div>; 60 + if (!permission_token) 61 + return ( 62 + <div className="p-4 text-lg text-center"> 63 + <p>Sorry, home page not found!</p> 64 + <p> 65 + This may be a glitch on our end. If you see this repeatedly please{" "} 66 + <a href="mailto:contact@leaflet.pub">send us a note</a>. 67 + </p> 68 + </div> 69 + ); 61 70 let [homeLeafletFacts, allLeafletFacts] = await Promise.all([ 62 71 supabaseServerClient.rpc("get_facts", { 63 72 root: permission_token.root_entity,
+19 -2
app/lish/[did]/[publication]/[rkey]/page.tsx
··· 49 49 params: Promise<{ publication: string; did: string; rkey: string }>; 50 50 }) { 51 51 let did = decodeURIComponent((await props.params).did); 52 - if (!did) return <div> can't resolve handle</div>; 52 + if (!did) 53 + return ( 54 + <div className="p-4 text-lg text-center"> 55 + <p>Sorry, can&apos;t resolve handle.</p> 56 + <p> 57 + This may be a glitch on our end. If you see this repeatedly please{" "} 58 + <a href="mailto:contact@leaflet.pub">send us a note</a>. 59 + </p> 60 + </div> 61 + ); 53 62 let agent = new BskyAgent({ service: "https://public.api.bsky.app" }); 54 63 let [{ data: document }, { data: profile }] = await Promise.all([ 55 64 supabaseServerClient ··· 65 74 agent.getProfile({ actor: did }), 66 75 ]); 67 76 if (!document?.data || !document.documents_in_publications[0].publications) 68 - return <div>notfound</div>; 77 + return ( 78 + <div className="p-4 text-lg text-center"> 79 + <p>Sorry, post not found!</p> 80 + <p> 81 + This may be a glitch on our end. If you see this repeatedly please{" "} 82 + <a href="mailto:contact@leaflet.pub">send us a note</a>. 83 + </p> 84 + </div> 85 + ); 69 86 let record = document.data as PubLeafletDocument.Record; 70 87 let firstPage = record.pages[0]; 71 88 let blocks: PubLeafletPagesLinearDocument.Block[] = [];
+19 -2
app/lish/[did]/[publication]/dashboard/page.tsx
··· 39 39 }) { 40 40 let params = await props.params; 41 41 let identity = await getIdentityData(); 42 - if (!identity || !identity.atp_did) return <div>not logged in</div>; 42 + if (!identity || !identity.atp_did) 43 + return ( 44 + <div className="p-4 text-lg text-center"> 45 + <p>Sorry, looks like you&apos;re not logged in.</p> 46 + <p> 47 + This may be a glitch on our end. If you see this repeatedly please{" "} 48 + <a href="mailto:contact@leaflet.pub">send us a note</a>. 49 + </p> 50 + </div> 51 + ); 43 52 let did = decodeURIComponent(params.did); 44 53 if (!did) return <PubNotFound />; 45 54 let { result: publication } = await get_publication_data.handler( ··· 100 109 } 101 110 102 111 const PubNotFound = () => { 103 - return <div>ain't no pub here</div>; 112 + return ( 113 + <div className="p-4 text-lg text-center"> 114 + <p>Sorry, publication not found!</p> 115 + <p> 116 + This may be a glitch on our end. If you see this repeatedly please{" "} 117 + <a href="mailto:contact@leaflet.pub">send us a note</a>. 118 + </p> 119 + </div> 120 + ); 104 121 };
+9 -1
app/lish/[did]/[publication]/page.tsx
··· 161 161 } 162 162 163 163 const PubNotFound = () => { 164 - return <div>ain't no pub here</div>; 164 + return ( 165 + <div className="p-4 text-lg text-center"> 166 + <p>Sorry, publication not found!</p> 167 + <p> 168 + This may be a glitch on our end. If you see this repeatedly please{" "} 169 + <a href="mailto:contact@leaflet.pub">send us a note</a>. 170 + </p> 171 + </div> 172 + ); 165 173 };