tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
291
fork
atom
a tool for shared writing and social publishing
291
fork
atom
overview
issues
28
pulls
pipelines
upload blobs sequentially instead of in parallel
awarm.space
6 months ago
d2118523
aec79ce9
+10
-12
1 changed file
expand all
collapse all
unified
split
actions
publishToPublication.ts
+10
-12
actions/publishToPublication.ts
···
84
84
.filter((b) => b.type == "link")
85
85
.map((b) => scan.eav(b.value, "link/preview")[0]);
86
86
let imageMap = new Map<string, BlobRef>();
87
87
-
await Promise.all(
88
88
-
[...links, ...images].map(async (b) => {
89
89
-
if (!b) return;
90
90
-
let data = await fetch(b.data.src);
91
91
-
if (data.status !== 200) return;
92
92
-
let binary = await data.blob();
93
93
-
let blob = await agent.com.atproto.repo.uploadBlob(binary, {
94
94
-
headers: { "Content-Type": binary.type },
95
95
-
});
96
96
-
imageMap.set(b.data.src, blob.data.blob);
97
97
-
}),
98
98
-
);
87
87
+
for (const b of [...links, ...images]) {
88
88
+
if (!b) continue;
89
89
+
let data = await fetch(b.data.src);
90
90
+
if (data.status !== 200) continue;
91
91
+
let binary = await data.blob();
92
92
+
let blob = await agent.com.atproto.repo.uploadBlob(binary, {
93
93
+
headers: { "Content-Type": binary.type },
94
94
+
});
95
95
+
imageMap.set(b.data.src, blob.data.blob);
96
96
+
}
99
97
100
98
let b: PubLeafletPagesLinearDocument.Block[] = blocksToRecord(
101
99
blocks,