Skip to content

Commit 216b30f

Browse files
fix: media fails to load (#6666)
1 parent f176f4b commit 216b30f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/lib/methods/handleMediaDownload.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { getMessageById } from '../database/services/Message';
1313
import { getThreadMessageById } from '../database/services/ThreadMessage';
1414
import database from '../database';
1515
import { getThreadById } from '../database/services/Thread';
16+
import { headers } from './helpers/fetch';
1617

1718
export type MediaTypes = 'audio' | 'image' | 'video';
1819
export type TDownloadState = 'to-download' | 'loading' | 'downloaded';
@@ -271,7 +272,9 @@ export function downloadMediaFile({
271272
return reject();
272273
}
273274
downloadKey = mediaDownloadKey(downloadUrl);
274-
downloadQueue[downloadKey] = FileSystem.createDownloadResumable(downloadUrl, path);
275+
downloadQueue[downloadKey] = FileSystem.createDownloadResumable(downloadUrl, path, {
276+
headers: headers as Record<string, string>
277+
});
275278
const result = await downloadQueue[downloadKey].downloadAsync();
276279

277280
if (!result) {

0 commit comments

Comments
 (0)