a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

prefetch page poll data

+5 -1
+4 -1
app/[leaflet_id]/page.tsx
··· 11 11 import { scanIndexLocal } from "src/replicache/utils"; 12 12 import { getRSVPData } from "actions/getRSVPData"; 13 13 import { PageSWRDataProvider } from "components/PageSWRDataProvider"; 14 + import { getPollData } from "actions/pollActions"; 14 15 15 16 export const preferredRegion = ["sfo1"]; 16 17 export const dynamic = "force-dynamic"; ··· 52 53 </div> 53 54 ); 54 55 55 - let [{ data }, rsvp_data] = await Promise.all([ 56 + let [{ data }, rsvp_data, poll_data] = await Promise.all([ 56 57 supabase.rpc("get_facts", { 57 58 root: rootEntity, 58 59 }), 59 60 getRSVPData(res.data.permission_token_rights.map((ptr) => ptr.entity_set)), 61 + getPollData(res.data.permission_token_rights.map((ptr) => ptr.entity_set)), 60 62 ]); 61 63 let initialFacts = (data as unknown as Fact<keyof typeof Attributes>[]) || []; 62 64 return ( 63 65 <PageSWRDataProvider 64 66 rsvp_data={rsvp_data} 67 + poll_data={poll_data} 65 68 leaflet_id={res.data.id} 66 69 domains={res.data.custom_domain_routes} 67 70 >
+1
components/PageSWRDataProvider.tsx
··· 10 10 leaflet_id: string; 11 11 domains: { domain: string }[]; 12 12 rsvp_data: Awaited<ReturnType<typeof getRSVPData>>; 13 + poll_data: Awaited<ReturnType<typeof getPollData>>; 13 14 children: React.ReactNode; 14 15 }) { 15 16 return (