updated eslint config

This commit is contained in:
Danny Coates 2019-08-02 12:03:53 -07:00
parent 20c063db7c
commit f036df5f47
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
9 changed files with 30 additions and 16 deletions

View file

@ -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';

View file

@ -1,4 +1,4 @@
/* global ReadableStream TransformStream */
/* global TransformStream */
export function transformStream(readable, transformer, oncancel) {
try {