a tool for shared writing and social publishing

hide looselefs in sidebar if user does not have any

Changed files
+5 -3
components
ActionBar
+5 -3
components/ActionBar/Publications.tsx
··· 23 23 currentPubUri: string | undefined; 24 24 }) => { 25 25 let { identity } = useIdentityData(); 26 - let looseleaves = identity?.permission_token_on_homepage.find( 27 - (f) => f.permission_tokens.leaflets_to_documents, 26 + let hasLooseleafs = !!identity?.permission_token_on_homepage.find( 27 + (f) => 28 + f.permission_tokens.leaflets_to_documents && 29 + f.permission_tokens.leaflets_to_documents[0].document, 28 30 ); 29 31 30 32 // don't show pub list button if not logged in or no pub list ··· 34 36 35 37 return ( 36 38 <div className="pubListWrapper w-full flex flex-col gap-1 sm:bg-transparent sm:border-0"> 37 - {looseleaves && ( 39 + {hasLooseleafs && ( 38 40 <> 39 41 <SpeedyLink 40 42 href={`/looseleafs`}