updated eslint config
This commit is contained in:
parent
20c063db7c
commit
f036df5f47
9 changed files with 30 additions and 16 deletions
|
@ -312,12 +312,13 @@ export function downloadStream(id, keychain) {
|
|||
|
||||
//////////////////
|
||||
|
||||
function download(id, keychain, onprogress, canceller) {
|
||||
async function download(id, keychain, onprogress, canceller) {
|
||||
const auth = await keychain.authHeader();
|
||||
const xhr = new XMLHttpRequest();
|
||||
canceller.oncancel = function() {
|
||||
xhr.abort();
|
||||
};
|
||||
return new Promise(async function(resolve, reject) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
xhr.addEventListener('loadend', function() {
|
||||
canceller.oncancel = function() {};
|
||||
const authHeader = xhr.getResponseHeader('WWW-Authenticate');
|
||||
|
@ -337,7 +338,6 @@ function download(id, keychain, onprogress, canceller) {
|
|||
onprogress(event.loaded);
|
||||
}
|
||||
});
|
||||
const auth = await keychain.authHeader();
|
||||
xhr.open('get', getApiUrl(`/api/download/blob/${id}`));
|
||||
xhr.setRequestHeader('Authorization', auth);
|
||||
xhr.responseType = 'blob';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* global ReadableStream TransformStream */
|
||||
/* global TransformStream */
|
||||
|
||||
export function transformStream(readable, transformer, oncancel) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue