diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 0ebc688..99e9110 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1372,13 +1372,13 @@ function doClaimYoutubeChannels() { dispatch({ 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, - public_key: address.public_key + public_key: address.pubkey }).then(response => { if (response && response.success) { Promise.all(response.map(channelMeta => { - if (channelMeta && channelMeta.channel && channelMeta.channel.transferable) { + if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) { return lbryRedux.Lbry.channel_import({ channel_data: channelMeta.channel.channel_certificate }); diff --git a/dist/bundle.js b/dist/bundle.js index 87ec818..011650a 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -2827,17 +2827,17 @@ function doClaimYoutubeChannels() { type: lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_YOUTUBE_IMPORT_STARTED }); lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].address_list().then(function (addressList) { - return addressList.find(function (el) { - return el.used_times === 0; - }); + return addressList.sort(function (a, b) { + return a.used_times - b.used_times; + })[0]; }).then(function (address) { return lbryio__WEBPACK_IMPORTED_MODULE_4__["default"].call('yt', 'transfer', { address: address.address, - public_key: address.public_key + public_key: address.pubkey }).then(function (response) { if (response && response.success) { Promise.all(response.map(function (channelMeta) { - if (channelMeta && channelMeta.channel && channelMeta.channel.transferable) { + if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) { return lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].channel_import({ channel_data: channelMeta.channel.channel_certificate }); diff --git a/src/redux/actions/user.js b/src/redux/actions/user.js index 95baee2..4be3be2 100644 --- a/src/redux/actions/user.js +++ b/src/redux/actions/user.js @@ -389,16 +389,16 @@ export function doClaimYoutubeChannels() { type: ACTIONS.USER_YOUTUBE_IMPORT_STARTED, }); 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 => Lbryio.call('yt', 'transfer', { address: address.address, - public_key: address.public_key, + public_key: address.pubkey, }).then(response => { if (response && response.success) { Promise.all( response.map(channelMeta => { - if (channelMeta && channelMeta.channel && channelMeta.channel.transferable) { + if (channelMeta && channelMeta.channel && channelMeta.channel.channel_certificate) { return Lbry.channel_import({ channel_data: channelMeta.channel.channel_certificate, });