your personal website on atproto - mirror blento.app

fix image upload

Florian 246278ed 56212a77

+15 -16
-4
docs/Beta.md
··· 6 6 - move subpages to own lexicon (app.blento.page) 7 7 - move description to markdownDescription and set description as text only 8 8 9 - - fix recent blentos only showing the last ~5 blentos 10 - 11 9 - card with big call to action button 12 10 13 11 - link card: save favicon and og image as blobs ··· 19 17 - allow editing profile stuff inline (in sidebar profile) 20 18 21 19 - allow setting base and accent color 22 - 23 - - go straight to edit mode (and redirect to edit mode on succesfull login) 24 20 25 21 - ask to fill with some default cards on page creation 26 22
+7 -4
src/lib/atproto/methods.ts
··· 229 229 if (!user.did || !user.client) throw new Error("Can't upload blob: Not logged in"); 230 230 231 231 const blobResponse = await user.client.post('com.atproto.repo.uploadBlob', { 232 - params: { 232 + input: blob, 233 + data: { 233 234 repo: user.did 234 - }, 235 - input: blob 235 + } 236 236 }); 237 237 238 - if (!blobResponse?.ok) return; 238 + if (!blobResponse?.ok) { 239 + return; 240 + } 239 241 240 242 const blobInfo = blobResponse?.data.blob as { 241 243 $type: 'blob'; ··· 294 296 }; 295 297 }; 296 298 }) { 299 + if (!did || !blob?.ref?.$link) return ''; 297 300 return `https://cdn.bsky.app/img/feed_thumbnail/plain/${did}/${blob.ref.$link}@jpeg`; 298 301 } 299 302
+1 -1
src/lib/cards/ImageCard/index.ts
··· 16 16 }, 17 17 upload: async (item) => { 18 18 if (item.cardData.blob) { 19 - item.cardData.image = await uploadBlob(item.cardData.blob); 19 + item.cardData.image = await uploadBlob({ blob: item.cardData.blob }); 20 20 21 21 delete item.cardData.blob; 22 22 }
+1 -1
src/lib/cards/VideoCard/index.ts
··· 39 39 if (item.cardData.blob) { 40 40 const blob = item.cardData.blob; 41 41 const aspectRatio = await getAspectRatio(blob); 42 - const uploadedBlob = await uploadBlob(blob); 42 + const uploadedBlob = await uploadBlob({ blob }); 43 43 44 44 item.cardData.video = { 45 45 $type: 'app.bsky.embed.video',
+6 -6
src/lib/website/load.ts
··· 88 88 89 89 if (!cardDef?.loadData) continue; 90 90 91 - additionDataPromises[cardType] = cardDef 92 - .loadData( 91 + try { 92 + additionDataPromises[cardType] = cardDef.loadData( 93 93 cards.filter((v) => cardType === v.value.cardType).map((v) => v.value) as Item[], 94 94 loadOptions 95 - ) 96 - .catch((error: Error) => { 97 - console.error('error getting additional data for', cardType, error); 98 - }); 95 + ); 96 + } catch { 97 + console.error('error getting additional data for', cardType); 98 + } 99 99 } 100 100 101 101 await Promise.all(Object.values(additionDataPromises));