tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
render standalone published docs properly on homepage
awarm.space
3 months ago
57e99536
656f7bf2
+12
-4
3 changed files
expand all
collapse all
unified
split
actions
getIdentityData.ts
app
(home-pages)
home
HomeLayout.tsx
components
Pages
PublicationMetadata.tsx
+1
actions/getIdentityData.ts
···
29
29
id,
30
30
root_entity,
31
31
permission_token_rights(*),
32
32
+
leaflets_to_documents(*, documents(*)),
32
33
leaflets_in_publications(*, publications(*), documents(*))
33
34
)
34
35
)
+10
-3
app/(home-pages)/home/HomeLayout.tsx
···
231
231
title={props?.titles?.[leaflet.root_entity] || "Untitled"}
232
232
token={leaflet}
233
233
draft={!!leaflet.leaflets_in_publications?.length}
234
234
-
published={!!leaflet.leaflets_in_publications?.find((l) => l.doc)}
234
234
+
published={
235
235
+
!!leaflet.leaflets_in_publications?.find((l) => l.doc) ||
236
236
+
!!leaflet.leaflets_to_documents?.find((l) => !!l.documents)
237
237
+
}
235
238
publishedAt={
236
239
leaflet.leaflets_in_publications?.find((l) => l.doc)?.documents
237
237
-
?.indexed_at
240
240
+
?.indexed_at ||
241
241
+
leaflet.leaflets_to_documents?.find((l) => !!l.documents)
242
242
+
?.documents?.indexed_at
238
243
}
239
244
leaflet_id={leaflet.root_entity}
240
245
loggedIn={!!identity}
···
286
291
287
292
let allTemplates = useTemplateState((s) => s.templates);
288
293
let filteredLeaflets = sortedLeaflets.filter(({ token: leaflet }) => {
289
289
-
let published = !!leaflet.leaflets_in_publications?.find((l) => l.doc);
294
294
+
let published =
295
295
+
!!leaflet.leaflets_in_publications?.find((l) => l.doc) ||
296
296
+
!!leaflet.leaflets_to_documents?.find((l) => l.document);
290
297
let drafts = !!leaflet.leaflets_in_publications?.length && !published;
291
298
let docs = !leaflet.leaflets_in_publications?.length;
292
299
let templates = !!allTemplates.find((t) => t.id === leaflet.id);
+1
-1
components/Pages/PublicationMetadata.tsx
···
175
175
let record = pub?.documents?.data as PubLeafletDocument.Record | null;
176
176
let publishedAt = record?.publishedAt;
177
177
178
178
-
if (!pub || !pub.publications) return null;
178
178
+
if (!pub) return null;
179
179
180
180
return (
181
181
<div className={`flex flex-col px-3 sm:px-4 pb-5 sm:pt-3 pt-2`}>