Fix posting images on web (#7105)

* Fix uploadBlob to handle blob: URI

* Patch expo-image-manipulator to support "compress" argument

* Narrow down the fix
This commit is contained in:
dan
2024-12-14 02:25:32 +00:00
committed by GitHub
parent 55222c5b0e
commit c5e60ba006
2 changed files with 52 additions and 1 deletions
+4 -1
View File
@@ -11,7 +11,10 @@ export async function uploadBlob(
input: string | Blob,
encoding?: string,
): Promise<ComAtprotoRepoUploadBlob.Response> {
if (typeof input === 'string' && input.startsWith('data:')) {
if (
typeof input === 'string' &&
(input.startsWith('data:') || input.startsWith('blob:'))
) {
const blob = await fetch(input).then(r => r.blob())
return agent.uploadBlob(blob, {encoding})
}