Common components refactor #1

Merged
akinwale merged 42 commits from common-components-refactor into master 2018-04-05 04:57:30 +02:00
2 changed files with 15 additions and 7 deletions
Showing only changes of commit 315e8702c0 - Show all commits

View file

@ -167,6 +167,7 @@ var LOADING_VIDEO_FAILED = exports.LOADING_VIDEO_FAILED = 'LOADING_VIDEO_FAILED'
var DOWNLOADING_STARTED = exports.DOWNLOADING_STARTED = 'DOWNLOADING_STARTED'; var DOWNLOADING_STARTED = exports.DOWNLOADING_STARTED = 'DOWNLOADING_STARTED';
var DOWNLOADING_PROGRESSED = exports.DOWNLOADING_PROGRESSED = 'DOWNLOADING_PROGRESSED'; var DOWNLOADING_PROGRESSED = exports.DOWNLOADING_PROGRESSED = 'DOWNLOADING_PROGRESSED';
var DOWNLOADING_COMPLETED = exports.DOWNLOADING_COMPLETED = 'DOWNLOADING_COMPLETED'; var DOWNLOADING_COMPLETED = exports.DOWNLOADING_COMPLETED = 'DOWNLOADING_COMPLETED';
var DOWNLOADING_CANCELED = exports.DOWNLOADING_CANCELED = 'DOWNLOADING_CANCELED';
var PLAY_VIDEO_STARTED = exports.PLAY_VIDEO_STARTED = 'PLAY_VIDEO_STARTED'; var PLAY_VIDEO_STARTED = exports.PLAY_VIDEO_STARTED = 'PLAY_VIDEO_STARTED';
var FETCH_AVAILABILITY_STARTED = exports.FETCH_AVAILABILITY_STARTED = 'FETCH_AVAILABILITY_STARTED'; var FETCH_AVAILABILITY_STARTED = exports.FETCH_AVAILABILITY_STARTED = 'FETCH_AVAILABILITY_STARTED';
var FETCH_AVAILABILITY_COMPLETED = exports.FETCH_AVAILABILITY_COMPLETED = 'FETCH_AVAILABILITY_COMPLETED'; var FETCH_AVAILABILITY_COMPLETED = exports.FETCH_AVAILABILITY_COMPLETED = 'FETCH_AVAILABILITY_COMPLETED';
@ -1047,6 +1048,13 @@ Lbry.file_delete = function () {
}); });
}; };
Lbry.file_set_status = function () {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return new Promise(function (resolve, reject) {
apiCall('file_set_status', params, resolve, reject);
});
};
Lbry.connectPromise = null; Lbry.connectPromise = null;
Lbry.connect = function () { Lbry.connect = function () {
if (Lbry.connectPromise === null) { if (Lbry.connectPromise === null) {

View file

@ -146,12 +146,12 @@ Lbry.status = () =>
Lbry.file_delete = (params = {}) => Lbry.file_delete = (params = {}) =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
apiCall( apiCall('file_delete', params, resolve, reject);
'file_delete', });
params,
resolve, Lbry.file_set_status = (params = {}) =>
reject new Promise((resolve, reject) => {
); apiCall('file_set_status', params, resolve, reject);
}); });
Lbry.connectPromise = null; Lbry.connectPromise = null;