Skip to content

Commit

Permalink
ELEMENTS-1650: View vs Download not working on cloud server
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuljain-dev committed Jul 19, 2023
1 parent c0c9dd0 commit 685bb20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/nuxeo-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@ import './nuxeo-resource.js';
if (
((fileContent && fileContent.data) ||
(files && files.length > 0 && files.every((item) => item.file && item.file.data))) &&
!this.isS3ProviderEnabled()
!this.isFollowRedirectEnabled()
) {
this.setDocumentViewDownloadProp(); // appends clientReason parameter for view vs download implementation
}
});
}

isS3ProviderEnabled() {
const useDirectUpload =
Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.s3 && Nuxeo.UI.config.s3.useDirectUpload;
return useDirectUpload ? String(useDirectUpload).toLowerCase() === 'true' : false;
isFollowRedirectEnabled() {
const followRedirect =
Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.url && Nuxeo.UI.config.url.followRedirect;
return followRedirect ? String(followRedirect).toLowerCase() === 'true' : false;
}

/* Fetch the document. */
Expand Down

0 comments on commit 685bb20

Please sign in to comment.