fix: pub key

And selection of address.
This commit is contained in:
Thomas Zarebczan 2019-09-22 11:11:13 -04:00
parent 54d58414ce
commit ff92e004f1
3 changed files with 8 additions and 10 deletions

5
dist/bundle.es.js vendored
View file

@ -1097,9 +1097,9 @@ function doClaimYoutubeChannels() {
dispatch({ dispatch({
type: lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_STARTED type: lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_STARTED
}); });
lbryRedux.Lbry.address_list().then(addressList => addressList.find(el => el.used_times === 0)).then(address => Lbryio.call('yt', 'transfer', { lbryRedux.Lbry.address_list().then(addressList => addressList.sort((a, b) => a.used_times - b.used_times)[0]).then(address => Lbryio.call('yt', 'transfer', {
address: address.address, address: address.address,
public_key: address.public_key public_key: address.pubkey
}).then(response => { }).then(response => {
if (response && response.success) { if (response && response.success) {
Promise.all(response.map(channelMeta => { Promise.all(response.map(channelMeta => {
@ -1120,7 +1120,6 @@ function doClaimYoutubeChannels() {
}); });
} }
})).catch(error => { })).catch(error => {
console.error('Youtube import error:', error);
dispatch({ dispatch({
type: lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_FAILURE, type: lbryRedux.ACTIONS.USER_YOUTUBE_IMPORT_FAILURE,
data: String(error) data: String(error)

9
dist/bundle.js vendored
View file

@ -2425,13 +2425,13 @@ function doClaimYoutubeChannels() {
type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_STARTED type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_STARTED
}); });
lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].address_list().then(function (addressList) { lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].address_list().then(function (addressList) {
return addressList.find(function (el) { return addressList.sort(function (a, b) {
return el.used_times === 0; return a.used_times - b.used_times;
}); })[0];
}).then(function (address) { }).then(function (address) {
return lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('yt', 'transfer', { return lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('yt', 'transfer', {
address: address.address, address: address.address,
public_key: address.public_key public_key: address.pubkey
}).then(function (response) { }).then(function (response) {
if (response && response.success) { if (response && response.success) {
Promise.all(response.map(function (channelMeta) { Promise.all(response.map(function (channelMeta) {
@ -2453,7 +2453,6 @@ function doClaimYoutubeChannels() {
} }
}); });
})["catch"](function (error) { })["catch"](function (error) {
console.error('Youtube import error:', error);
dispatch({ dispatch({
type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_FAILURE, type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_FAILURE,
data: String(error) data: String(error)

View file

@ -389,11 +389,11 @@ export function doClaimYoutubeChannels() {
type: ACTIONS.USER_YOUTUBE_IMPORT_STARTED, type: ACTIONS.USER_YOUTUBE_IMPORT_STARTED,
}); });
Lbry.address_list() Lbry.address_list()
.then(addressList => addressList.find(el => el.used_times === 0)) .then(addressList => addressList.sort((a, b) => a.used_times - b.used_times)[0])
.then(address => .then(address =>
Lbryio.call('yt', 'transfer', { Lbryio.call('yt', 'transfer', {
address: address.address, address: address.address,
public_key: address.public_key, public_key: address.pubkey,
}).then(response => { }).then(response => {
if (response && response.success) { if (response && response.success) {
Promise.all( Promise.all(