fix: error fetching attachments from blob

This commit is contained in:
Ribas160
2025-11-05 17:33:08 +02:00
parent 5e10469ffc
commit a7b253a43a
3 changed files with 6 additions and 4 deletions

View File

@@ -5214,22 +5214,23 @@ jQuery.PrivateBin = (function($) {
cipherMessage['attachment'] = attachments.map(attachment => attachment[0]);
cipherMessage['attachment_name'] = attachments.map(attachment => attachment[1]);
cipherMessage['attachment'] = await Promise.all(cipherMessage['attachment'].map(async (attachment) => {
cipherMessage['attachment'] = await Promise.all(cipherMessage['attachment'].map(async (attachment, i) => {
// we need to retrieve data from blob if browser already parsed it in memory
if (typeof attachment === 'string' && attachment.startsWith('blob:')) {
Alert.showStatus(
[
'Retrieving cloned file \'%s\' from memory...',
attachment[1]
cipherMessage['attachment_name'][i]
],
'copy'
);
try {
const blobData = await $.ajax({
type: 'GET',
url: `${attachment}`,
url: attachment,
processData: false,
timeout: 10000,
dataType: 'binary',
xhrFields: {
withCredentials: false,
responseType: 'blob'