fix timeout with remote

f
This commit is contained in:
Thomas Zarebczan 2022-05-05 13:04:46 -04:00
parent c6856da247
commit a0097dc3ce
No known key found for this signature in database
GPG key ID: 767B41E1BB7346F2

View file

@ -50,7 +50,9 @@ export function makeUploadRequest(
let xhr = new XMLHttpRequest();
xhr.open('POST', ENDPOINT);
xhr.setRequestHeader(X_LBRY_AUTH_TOKEN, token);
if (!remoteUrl) {
xhr.timeout = PUBLISH_FETCH_TIMEOUT_MS;
}
xhr.responseType = 'json';
xhr.upload.onprogress = (e) => {
const percentage = ((e.loaded / e.total) * 100).toFixed(2);