From 31647e4ee7371ca05a9fa13b3ac3f5b4a794383d Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 8 Jul 2020 01:40:43 -0400 Subject: [PATCH] add back 'remove' function --- dist/bundle.es.js | 11 ++++++++--- dist/flow-typed/LbryFirst.js | 10 +++++----- src/lbry-first.js | 5 +++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 2f9771f..1002bcd 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1261,7 +1261,7 @@ const LbryFirst = { upload: (params = {}) => { // Only upload when originally publishing for now if (!params.file_path) { - return new Promise(); + return Promise.resolve(); } const uploadParams = { @@ -1285,6 +1285,11 @@ const LbryFirst = { return lbryFirstCallWithResult('youtube.Signup', emptyParams); }, + remove: () => { + const emptyParams = {}; + return lbryFirstCallWithResult('youtube.Remove', emptyParams); + }, + // Connect to lbry-first connect: () => { if (LbryFirst.connectPromise === null) { @@ -1330,14 +1335,14 @@ function checkAndParse$1(response) { function apiCall$1(method, params, resolve, reject) { const counter = new Date().getTime(); - params = [params]; + const paramsArray = [params]; const options = { method: 'POST', headers: LbryFirst.apiRequestHeaders, body: JSON.stringify({ jsonrpc: '2.0', method, - params, + params: paramsArray, id: counter }) }; diff --git a/dist/flow-typed/LbryFirst.js b/dist/flow-typed/LbryFirst.js index 3cad4dc..850fa88 100644 --- a/dist/flow-typed/LbryFirst.js +++ b/dist/flow-typed/LbryFirst.js @@ -71,9 +71,9 @@ declare type UploadResponse = { declare type HasYTAuthResponse = { HashAuth: boolean, -} +}; -declare type YTSignupResponse = {} +declare type YTSignupResponse = {}; // // Types used in the generic LbryFirst object that is exported @@ -93,7 +93,7 @@ declare type LbryFirstTypes = { stop: () => Promise, status: () => Promise, version: () => Promise, - upload: (params: {}) => Promise, - hasYTAuth: () =>Promise, - ytSignup: () =>Promise, + upload: any => Promise, + hasYTAuth: () => Promise, + ytSignup: () => Promise, }; diff --git a/src/lbry-first.js b/src/lbry-first.js index d0e9f3b..8b2deb7 100644 --- a/src/lbry-first.js +++ b/src/lbry-first.js @@ -74,6 +74,11 @@ const LbryFirst: LbryFirstTypes = { return lbryFirstCallWithResult('youtube.Signup', emptyParams); }, + remove: () => { + const emptyParams = {}; + return lbryFirstCallWithResult('youtube.Remove', emptyParams); + }, + // Connect to lbry-first connect: () => { if (LbryFirst.connectPromise === null) {