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
handle missing preview images
awarm.space
8 months ago
bd7c6328
a5ab5ba1
+4
-1
1 changed file
expand all
collapse all
unified
split
actions
publishToPublication.ts
+4
-1
actions/publishToPublication.ts
···
80
80
let imageMap = new Map<string, BlobRef>();
81
81
await Promise.all(
82
82
[...links, ...images].map(async (b) => {
83
83
+
if (!b) return;
83
84
let data = await fetch(b.data.src);
84
85
if (data.status !== 200) return;
85
86
let binary = await data.blob();
···
268
269
let [description] = scan.eav(b.value, "link/description");
269
270
let [src] = scan.eav(b.value, "link/url");
270
271
if (!src) return;
271
271
-
let blobref = imageMap.get(previewImage.data.src);
272
272
+
let blobref = previewImage
273
273
+
? imageMap.get(previewImage?.data.src)
274
274
+
: undefined;
272
275
let [title] = scan.eav(b.value, "link/title");
273
276
let block: $Typed<PubLeafletBlocksWebsite.Main> = {
274
277
$type: "pub.leaflet.blocks.website",