mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-07-17 16:39:40 +00:00
Update js/privatebin.js
Thanks, updated this to avoid relying on `Array.isArray()` for the `FileList` case and to always set `attachment_name` to an array. Co-authored-by: Mikhail Romanov <42250412+Ribas160@users.noreply.github.com>
This commit is contained in:
parent
8a7f7a60a5
commit
88b7cd8e96
1 changed files with 1 additions and 3 deletions
|
|
@ -5230,9 +5230,7 @@ jQuery.PrivateBin = (function($) {
|
|||
};
|
||||
if (attachmentsData.length) {
|
||||
cipherMessage['attachment'] = attachmentsData;
|
||||
const fileNames = AttachmentViewer.getFiles();
|
||||
if (fileNames && Array.isArray(fileNames)) {
|
||||
cipherMessage['attachment_name'] = fileNames.map((fileInfo => fileInfo.name));
|
||||
cipherMessage['attachment_name'] = AttachmentViewer.getFiles()?.map((fileInfo => fileInfo.name)) ?? [];
|
||||
}
|
||||
} else if (AttachmentViewer.hasAttachment()) {
|
||||
// fall back to cloned part
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue