a tool for shared writing and social publishing

don't call get_leaflet_data if no permission_token

+5 -5
+5 -5
components/PageSWRDataProvider.tsx
··· 48 48 49 49 let useLeafletData = () => { 50 50 let { permission_token } = useReplicache(); 51 - return useSWR( 52 - `${permission_token.id}-leaflet_data`, 53 - async () => 54 - (await callRPC("get_leaflet_data", { token_id: permission_token.id })) 55 - ?.result, 51 + return useSWR(`${permission_token.id}-leaflet_data`, async () => 52 + permission_token.id 53 + ? (await callRPC("get_leaflet_data", { token_id: permission_token.id })) 54 + ?.result 55 + : undefined, 56 56 ); 57 57 }; 58 58 export function useLeafletPublicationData() {