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
27
pulls
pipelines
fix publication metadata for view only drafts
awarm.space
6 months ago
898420f2
a9f39f23
+8
-3
1 changed file
expand all
collapse all
unified
split
app
[leaflet_id]
page.tsx
+8
-3
app/[leaflet_id]/page.tsx
···
76
76
);
77
77
let rootEntity = res.data?.root_entity;
78
78
if (!rootEntity || !res.data) return { title: "Leaflet not found" };
79
79
-
if (res.data.leaflets_in_publications[0]) {
79
79
+
let publication_data =
80
80
+
res.data?.leaflets_in_publications?.[0] ||
81
81
+
res.data?.permission_token_rights[0].entity_sets?.permission_tokens?.find(
82
82
+
(p) => p.leaflets_in_publications.length,
83
83
+
)?.leaflets_in_publications?.[0];
84
84
+
if (publication_data) {
80
85
return {
81
81
-
title: res.data.leaflets_in_publications[0].title || "Untitled",
82
82
-
description: res.data.leaflets_in_publications[0].description,
86
86
+
title: publication_data.title || "Untitled",
87
87
+
description: publication_data.description,
83
88
};
84
89
}
85
90
let { data } = await supabaseServerClient.rpc("get_facts", {