update build

This commit is contained in:
Sean Yesmunt 2020-10-23 20:50:10 -04:00
parent 1b6f280371
commit d91b971bfe

15
dist/bundle.js vendored
View file

@ -514,7 +514,8 @@ var Lbryio = {
exchangeLastFetched: null, exchangeLastFetched: null,
CONNECTION_STRING: 'https://api.lbry.com/' CONNECTION_STRING: 'https://api.lbry.com/'
}; };
var EXCHANGE_RATE_TIMEOUT = 20 * 60 * 1000; // We can't use env's because they aren't passed into node_modules var EXCHANGE_RATE_TIMEOUT = 20 * 60 * 1000;
var INTERNAL_APIS_DOWN = 'internal_apis_down'; // We can't use env's because they aren't passed into node_modules
Lbryio.setLocalApi = function (endpoint) { Lbryio.setLocalApi = function (endpoint) {
Lbryio.CONNECTION_STRING = endpoint.replace(/\/*$/, '/'); // exactly one slash at the end; Lbryio.CONNECTION_STRING = endpoint.replace(/\/*$/, '/'); // exactly one slash at the end;
@ -537,7 +538,11 @@ Lbryio.call = function (resource, action) {
return response.json(); return response.json();
} }
return response.json().then(function (json) { if (response.status === 500) {
return Promise.reject(INTERNAL_APIS_DOWN);
}
if (response) return response.json().then(function (json) {
var error; var error;
if (json.error) { if (json.error) {
@ -647,7 +652,11 @@ Lbryio.authenticate = function () {
return Lbryio.getCurrentUser().then(function (user) { return Lbryio.getCurrentUser().then(function (user) {
return user; return user;
})["catch"](function () { })["catch"](function (error) {
if (error === INTERNAL_APIS_DOWN) {
throw new Error('Internal APIS down');
}
return false; return false;
}); });
}).then(function (user) { }).then(function (user) {