Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nd0ut committed Oct 26, 2023
1 parent c0ffc43 commit ce9da08
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions blocks/DataOutput/DataOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@ export class DataOutput extends UploaderBlock {
this.$.output = null;
return;
}
const allUploaded = data.every((item) => item.isUploaded);
if (allUploaded && (this.cfg.groupOutput || this.hasAttribute(this.dict.GROUP_ATTR))) {
let uuidList = data.map((fileDesc) => {
return fileDesc.uuid + (fileDesc.cdnUrlModifiers ? `/${fileDesc.cdnUrlModifiers}` : '');
});
const validationOk = data.every((item) => item.isValid);
if (!validationOk) {
if (this.cfg.groupOutput || this.hasAttribute(this.dict.GROUP_ATTR)) {
const isAllUploadedAndValid = data.every((item) => item.isUploaded && item.isValid);
if (!isAllUploadedAndValid) {
this.$.output = {
groupData: undefined,
files: data,
};
return;
}

const uploadClientOptions = await this.getUploadClientOptions();
const uuidList = data.map((fileDesc) => {
return fileDesc.uuid + (fileDesc.cdnUrlModifiers ? `/${fileDesc.cdnUrlModifiers}` : '');
});
const resp = await uploadFileGroup(uuidList, uploadClientOptions);
this.$.output = {
groupData: resp,
Expand Down

0 comments on commit ce9da08

Please sign in to comment.