Added version call to lbry.js since proxy polyfill still doesn't work properly

This commit is contained in:
Akinwale Ariwodola 2018-04-21 21:40:54 +01:00
parent 8c8c937ea7
commit bdf7639bb2
2 changed files with 24 additions and 3 deletions

11
dist/bundle.js vendored
View file

@ -1773,13 +1773,22 @@ function apiCall(method /*: string*/, params /*: ?{}*/, resolve /*: Function*/,
// core
Lbry.status = function () {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return new Promise(function (resolve, reject) {
apiCall('status', {}, function (status) {
apiCall('status', params, function (status) {
resolve(status);
}, reject);
});
};
Lbry.version = function () {
return new Promise(function (resolve, reject) {
apiCall('version', {}, function (versionInfo) {
resolve(versionInfo);
}, reject);
});
};
Lbry.file_delete = function () {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return new Promise(function (resolve, reject) {

View file

@ -50,11 +50,11 @@ function apiCall(method: string, params: ?{}, resolve: Function, reject: Functio
}
// core
Lbry.status = () =>
Lbry.status = (params = {}) =>
new Promise((resolve, reject) => {
apiCall(
'status',
{},
params,
status => {
resolve(status);
},
@ -62,6 +62,18 @@ Lbry.status = () =>
);
});
Lbry.version = () =>
new Promise((resolve, reject) => {
apiCall(
'version',
{},
versionInfo => {
resolve(versionInfo);
},
reject
);
});
Lbry.file_delete = (params = {}) =>
new Promise((resolve, reject) => {
apiCall('file_delete', params, resolve, reject);